Correctness-Aware Repository Filtering Under Maximum Effective Context Window Constraints
Not on the map. Why?
Abstract (arXiv)
Context window efficiency is a practical constraint in large language model (LLM)-based developer tools. Paulsen [12] shows that all tested models degrade in accuracy well before their advertised context limits the Maximum Effective Context Window (MECW) which makes context construction a quality problem, not just a cost one. Modern software repositories routinely contain large non-code artifacts compiled datasets, binary model weights, minified JavaScript bundles, and gigabyte-scale log files that overflow the context window and push out task-relevant source code. We present a correctness-aware context hygiene framework: a pre-execution, size-based heuristic filter that intercepts repository scans before tokenization, using only OS-level stat() metadata with sub-millisecond overhead. Semantic retrieval approaches such as RepoCoder, GraphRAG, and AST-based chunking require index construction and query-time inference before any filtering decision is reached. Our framework, by contrast, requires no indexing and operates at <0.01 ms per file decision. Across 10 real open-source repositories (22,046 files, 5 languages), the proposed SizeFilter at θ=1 MB achieves 79.6% (±13.2%) mean token reduction at 0.30 ms overhead: the HybridFilter achieves 89.3% (±9.0%) the lowest variance of any filter evaluated. A token-density study across 2,688 files confirms a strong linear correlation (Pearson r=0.997, k=0.250 tokens/byte). A limited-scope evaluation (18 tasks, CodeLlama-7B-Instruct) yields 72% file-level accuracy under filtering versus 25% at baseline; hallucination frequency declines from 61% to 17%. All code and data are released for reproducibility.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 38 references that are in the map. First posted on arXiv 14 May 2026.
Builds on
15 of 38 references.
References · 15
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
- 2024From Local to Global: A Graph RAG Approach to Query-Focused Summarizationcited by 1,453
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 841
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 287
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024On The Importance of Reasoning for Context Retrieval in Repository-Level Code Editing
- 2026Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation
- 2026MRCoder: An Efficient Context Selecting Approach for Repository-Level Code Generation ↗
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation
- 2026ContextSniper: AntTrail's Token-Efficient Code Memory for Repository-Level Program Repair
- 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents
- 2026FastContext: Training Efficient Repository Explorer for Coding Agents
- 2026Better Call Grep: Evaluating and Improving Grep-Like Lexical Retrieval for Repository-Level Code Completion