LLM Code Generation Test: Long Output Generation

December 10, 2024 ยท View on GitHub

alt text

10-Dec-24

Open in Streamlit

The purpose of this experiment was to compare and evaluate the capability of different code generation large language models to generate a single long continuous output.

The prompt used as well as all the outputs are recorded in the data folder. The demanding prompt requested that the LLM assist in the generation of a Open AI Whisper Speech to text transcription GUI for Linux.

Various large language models were tested across different platforms, including models deployed on Hugging Face, those available via Open Router, and those hosted locally on LM Studio.

The outputs were recorded in their original form in the outputs folder and a script was used to calculate the character count as well as the percentage of code in the outputs, which was calculated by computing the character count within code fences and comparing that to the total character count in the output.

Additionally, the number of code blocks within each single output was computed by calculating the number of code blocks in the output.

Qwen 2.5 Coder generated the longest single output at 13,950 characters, almost 90% of which constituted code spread across five different code blocks.

Discrepancies between runs on the same platform, and when comparing the same model's output across different access interfaces, were overall quite small. Quen 2.5 when accessed via Open Router via its API yielded an output of 13,159 characters with a code percentage of 82%. This works out to a difference in output length of 5.7 %.

Qwen's larger 72B parameter instruction model generated an output that was almost as long as that of its smaller code specific sibling, 2.5 Coder (12,921 characters, 84% within codefences).

The lengthiest response among the "Western" models was the one generated by OpenAI's o-1 Preview, accessed via API, which generated 13,622 characters (82% within codefences) and the largest number of unique code blocks at 10.

Data Table

MODELACCESS UICHAR COUNTCODE CHARSCODE %CODE BLOCKS
Qwen 2.5 Coder 32BHugging Face Chat139501235088.53%5
o1 PreviewLibreChat136221122182.37%10
Qwen 2.5 Coder 32BOpen Web UI131591082282.24%7
Qwen 72BHugging Face Chat129211084083.89%7
DeepSeekOnline Playground10105882087.28%8
Claude 3.5 SonnetLibreChat10007870586.99%2
Gemini 1.5 ProGoogle AI Studio7926658383.06%3
Le ChatMistral7719659585.44%4
Phind 70BSite7678547471.29%6
Llama 3.1 BBLocal LM7321627985.77%2
Llama 3.3 70BHugging Face Chat7195471865.57%3
Cohere Command R PlusHugging Face Chat7145606984.94%1
DeepSeekChatbox Desktop UI7017429761.24%1
Nova Pro 10Open Router6954591185.00%1
Qwen 2.5 7BLM Studio6773525377.56%5
Nova Pro 10Open Router Web UI6568553684.29%5
DeepSeek Coder 7BLM Studio6372524682.33%2
GPT-3.5 16KLibreChat3972312978.78%1
Codetral MambaPython GUI209100.00%0

Charts

alt text

alt text

alt text

Author

Daniel Rosehill
(public at danielrosehill dot com)

Licensing

This repository is licensed under CC-BY-4.0 (Attribution 4.0 International) License

Summary of the License

The Creative Commons Attribution 4.0 International (CC BY 4.0) license allows others to:

  • Share: Copy and redistribute the material in any medium or format.
  • Adapt: Remix, transform, and build upon the material for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

License Terms

  • Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • No additional restrictions: You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

For the full legal code, please visit the Creative Commons website.