Bug in the CodeStack

Our new code-focused needle in the haystack test measures how well LLMs can find bugs in code.
Models
11
Metric
Average retrieval accuracy (%)

Context

  • What

    In collaboration with Andy Lee (from Wat.ai), we built a new benchmark called 'Bug In The Code Stack' (BICS) to test how well LLMs can find syntactic bugs in large Python codebases.
  • Why

    As LLMs' context window sizes grow, their use as coding assistants for large codebases is increasing. We wanted to understand how longer context lengths impact their retrieval performance.
  • How

    We use auto-assembled Python source code as the haystack and a syntactic bug placed within the source code as the needle. The LLM is tasked with finding the line number and the type of the bug.

TLDR

  1. 01GPT-3.5-Turbo showed lower accuracy on the BICS benchmark than the BABILONG benchmark at the same context length and target depth, indicating that LLMs struggle more on code-based tasks than text-based tasks at long context length.
  2. 02GPT-4o showed the best performance, closely followed by GPT-4-Turbo. The GPT-4-Series especially performed well at long context lengths compared to other models.
  3. 03Gemini 1.5-Pro is ~3x better than Gemini 1.0 Pro; as Google claimed, 1.5-Pro's performance stays constant across all context lengths and target depths.
  4. 04Codestral 22B performed on par with GPT-3.5-Turbo and Llama3-70B despite being a significantly smaller model.

Results

Model results; select a column heading to sort.
Provider
OpenAIGPT-4o82.72
OpenAIGPT-4-Turbo78.08
AnthropicClaude 3 Opus59.52
GoogleGemini 1.5-Pro52.48
GoogleGemini 1.5-Flash49.44
OpenAIGPT-3.5-Turbo36.48
Mistral AICodestral 22B36.32
MetaLlama3-70B35.36
CohereCommand-R+30.08
GoogleGemini-1.0-Pro16.32
QwenCodeQwen 1.50.48