OctoLong: Mid-Training On Cross-Repository Code Contexts Enhances Long-Context Modeling
OctoLong builds dependency-rich, cross-repository training contexts by following code references. The results suggest long-context coding models benefit from linked program structure, not just larger text windows.
OctoLong recursively follows code references using an AST parser, language server and package manager. Models from **600M to 14B parameters** receive mid-training on a **roughly 50B-token mixture**, including about **6.2B OctoLong tokens**, then roughly 10B instruction-tuning tokens.
For repository agents, this supports evaluating models on dependency traversal and state tracking rather than context-window size alone. It also suggests that context pipelines should preserve symbols, packages and cross-repository relationships.
OctoLong recursively follows code references using an AST parser, language server and package manager. Models from **600M to 14B parameters** receive mid-training on a **roughly 50B-token mixture**, including about **6.2B OctoLong tokens**, then roughly 10B instruction-tuning tokens. For repository agents, this supports evaluating models on dependency traversal and state tracking rather than context-window size alone. It also suggests that context pipelines should preserve symbols, packages and cross-repository relationships. The reported gains come from replacing **12% of traditional context-extension data** and evaluating against 18 open-weight long-context models. The abstract calls the gains substantial but provides no task-level scores, so model-selection conclusions require the full evaluation.
This makes structured cross-repository data a concrete mid-training intervention rather than treating long-context ability as a function of window size alone. It reinforces task-shaped training mixtures and shifts repository-model selection toward dependency traversal, symbol preservation, and state tracking, but the missing task-level scores prevent concluding that OctoLong-trained models outperform particular available routes.