Building LLMs for Code Repair
Replit finetuned a 7B code model (DeepSeek-Coder-Instruct-v1.5) to repair Python errors flagged by LSP diagnostics. Only 10% of these diagnostics come with deterministic fixes, while hundreds of millions are logged daily. Training data comes from replaying Operational Transformation histories to reconstruct the project state at each diagnostic. LLM-synthesized numbered line diffs are then generated with DSPy, verified, and distilled. Sentinel-token schemas replace natural-language instructions, and training ran on 8xH100 with LLM Foundry, FSDP and 4 epochs. Evaluation uses a new Replit repair benchmark plus a contamination-resistant Leetcode set built from DebugBench and recent LiveCodeBench-style problems.
Related posts
- Code Llama: Llama 2 learns to code
Hugging Face mediumAdeptCode Llama is a family of 7B, 13B and 34B Llama 2 derivatives trained on 500B tokens of code. It comes in base, Python-specialized and instruction-tuned variants, has a 16k training context that extrapolates to 100k via RoPE frequency scaling, and supports fill-in-the-middle infilling in the 7B and 13B models. Hugging Face integration starts at transformers 4.33, with code for completion, infilling with the <FILL_ME> token, the Llama 2 chat prompt template, and 4-bit bitsandbytes loading. Recommended setup is float16 for inference and bfloat16 for fine-tuning, plus GPU sizing guidance for TGI/Inference Endpoints and HumanEval/MultiPL-E evaluation.
- StarCoder2-Instruct: Fully Transparent and Permissive Self-Alignment for Code Generation
Hugging Face hardMasterStarCoder2-15B-Instruct is instruction-tuned entirely on data generated by its own base model, with no human annotations or distillation from proprietary LLMs. The pipeline filters 5M docstring-bearing Python functions from The Stack v1 down to 250k seeds using Pyright type checking, decontamination, LLM-judged docstring quality and MinHash deduplication. It then has the model extract code concepts and write 238k instructions, and keeps only responses that pass self-generated tests executed in a sandbox, ending with 50k SFT pairs. The model scores 72.6 on HumanEval, beating CodeLlama-70B-Instruct, and outperforms a GPT-4-distilled variant on LiveCodeBench, suggesting models learn better from in-distribution self-generated data.
- Replit’s new AI Model now available on Hugging Face
Replit easyNoviceReplit Code V1.5 3B is an open code-completion model released on Hugging Face under a license that allows commercial use. It was trained on 1 trillion tokens of permissively licensed code from the Stack plus StackExchange content, covers 30 languages with a custom 32K vocabulary, and uses Grouped Query Attention, Flash Attention Triton kernels, ALiBi and the LionW optimizer. Replit reports leading HumanEval and MultiPL-E scores for its size, and a version fine-tuned on Replit user code outperforms CodeLlama 7B. A transformers snippet shows how to load the model and generate code with sampling parameters.
- StarCoder: A State-of-the-Art LLM for Code
Hugging Face easyNoviceStarCoder and StarCoderBase are ~15B-parameter code LLMs trained on 1 trillion tokens of permissively licensed GitHub data from The Stack 1.2, covering 80+ languages, commits, issues and notebooks, with StarCoder further fine-tuned on 35B Python tokens. With an 8K+ token context, they beat other open code models and match or exceed OpenAI's code-cushman-001 on HumanEval, MBPP, MultiPL-E and DS-1000. A solution-file prompt prefix lifts StarCoder's HumanEval score from 34% to 40.8%, and prompting alone turns the model into a technical assistant. The release includes weights under OpenRAIL-M, training code, an evaluation harness, a PII-redaction dataset and a code attribution tool.
- Introducing the LiveCodeBench Leaderboard - Holistic and Contamination-Free Evaluation of Code LLMs
Hugging Face easyNoviceLiveCodeBench is a code-LLM benchmark built from LeetCode, AtCoder and CodeForces contest problems annotated with release dates, so models can be scored only on problems published after their training cutoff to avoid contamination. Beyond code generation it evaluates self-repair from error feedback, code execution (predicting a function's output) and test output prediction, all scored with Pass@1. GPT-4-Turbo leads most scenarios and widens its lead on self-repair, while Claude-3-Opus wins test output prediction and Mistral-Large does relatively better on reasoning-heavy tasks. Models can be evaluated with the lcb_runner CLI and submitted to the leaderboard.