Live data from Hacker News

Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

phind.com

1–10 of 306 posts

Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#1
Hi HN,

We have fine-tuned CodeLlama-34B and CodeLlama-34B-Python on an internal Phind dataset that achieved 67.6% and 69.5% pass@1 on HumanEval, respectively. GPT-4 achieved 67%. To ensure result validity, we applied OpenAI's decontamination methodology to our dataset.

The CodeLlama models released yesterday demonstrate impressive performance on HumanEval.

- CodeLlama-34B achieved 48.8% pass@1 on HumanEval

- CodeLlama-34B-Python achieved 53.7% pass@1 on HumanEval

We have fine-tuned both models on a proprietary dataset of ~80k high-quality programming problems and solutions. Instead of code completion examples, this dataset features instruction-answer pairs, setting it apart structurally from HumanEval. We trained the Phind models over two epochs, for a total of ~160k examples. LoRA was not used — both models underwent a native fine-tuning. We employed DeepSpeed ZeRO 3 and Flash Attention 2 to train these models in three hours using 32 A100-80GB GPUs, with a sequence length of 4096 tokens.

Furthermore, we applied OpenAI's decontamination methodology to our dataset to ensure valid results, and found no contaminated examples.

The methodology is:

- For each evaluation example, we randomly sampled three substrings of 50 characters or used the entire example if it was fewer than 50 characters.

- A match was identified if any sampled substring was a substring of the processed training example.

For further insights on the decontamination methodology, please refer to Appendix C of OpenAI's technical report.

Presented below are the pass@1 scores we achieved with our fine-tuned models:

- Phind-CodeLlama-34B-v1 achieved 67.6% pass@1 on HumanEval

- Phind-CodeLlama-34B-Python-v1 achieved 69.5% pass@1 on HumanEval

Note on GPT-4

According to the official technical report in March, OpenAI reported a pass@1 score of 67% for GPT-4's performance on HumanEval. Since then, there have been claims reporting higher scores. However, it's essential to note that there hasn't been any concrete evidence pointing towards an enhancement in the model's coding abilities since then. It's also crucial to highlight that these elevated figures lack the rigorous contamination analysis that the official statistic underwent, making them less of a reliable comparison. As a result, we consider 67% as the pass@1 score for GPT-4.

Download

We are releasing both models on Huggingface for verifiability and to bolster the open-source community. We welcome independent verification of results.

Phind-CodeLlama-34B-v1: https://huggingface.co/Phind/Phind-CodeLlama-34B-v1

Phind-CodeLlama-34B-Python-v1: https://huggingface.co/Phind/Phind-CodeLlama-34B-Python-v1

We'd love to hear your thoughts!

Best,

The Phind Team

Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B
phind.com

Re: Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#3
post #2

Did you use the same pass@1 generation method as in the code llama paper (greedy decoding)? I couldn't find this in the blog post.

We used sampling with temperature=0.1. Reproduction details can be found on the Huggingface model card: https://huggingface.co/Phind/Phind-CodeLlama-34B-v1

Re: Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#5
post #2

Did you use the same pass@1 generation method as in the code llama paper (greedy decoding)? I couldn't find this in the blog post.

We used sampling with temperature=0.1. Reproduction details can be found on the Huggingface model card: https://huggingface.co/Phind/Phind-CodeLlama-34B-v1

Got it, thanks - and thanks for the model! I'd be interested in the results if anyone benchmarks without sampling.

Edit: it could also be misleading to directly compare humaneval pass@1 against codellama without the same generation methodology. (possibly against GPT-4, also, but I don't know their methodology).

Re: Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#8
Are you planning to switch to programming-language optimized model inside Phind? So, if a user is asking for something related to Python, that the python-optimized model gets used?

If so:

The Object Pascal language is completely out of fashion, and the most non-hyped language there is. However, there are hundreds of thousands of active users of Delphi, FreePascal and Lazarus. And due to the language being stable for over 20 years, there also is a gigantic amount of highest-quality code available. As most of it is neither on Github nor StackOverflow, Pascal code is dramatically underrepresented in GPT3.5, GPT-4 - and therefore also in Phind.

I'd like to finally be able to use AI-assisted programming with Pascal.

In case you are interested in that, I would be willing to internally pay for the work to prepare a good dataset of high quality code with comments/context/prompts.

If you are not interested, is there any chance that you are going to release the code and toolchain used to fine-tune CodeLlama, so I could do it myself?

Re: Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#9

Are you planning to switch to programming-language optimized model inside Phind? So, if a user is asking for something related to Python, that the python-optimized model gets used? If so: The Object Pascal language is completely out of fashion, and the most non-hyped language there is. However, there are hundreds of thousands of active users of Delphi, FreePascal and Lazarus. And due to the language being stable for…

Yes, this is the direction we're heading towards! We're building a mixture of experts of different coding models that we will deploy for precisely this use case.

Re: Beating GPT-4 on HumanEval with a fine-tuned CodeLlama-34B

#10

Are you planning to switch to programming-language optimized model inside Phind? So, if a user is asking for something related to Python, that the python-optimized model gets used? If so: The Object Pascal language is completely out of fashion, and the most non-hyped language there is. However, there are hundreds of thousands of active users of Delphi, FreePascal and Lazarus. And due to the language being stable for…

> I would be willing to internally pay for the work

What kind of budget do you think this will require?

Post reply on HN