OctoLong: Mid-Training On Cross-Repository Code Contexts Enhances Long-Context Modeling· OctoLong:跨仓库代码上下文增强长上下文建模
Context lengths of language models (LMs) have dramatically increased, driven by the demands for in-context learning, self-improvement, and long-horizon agentic workflows. Existing long-context corpora, however, are dominated by books, academic articles, and code repositories, which are finite resources and often scarce in long-distance dependencies. In this work, we introduce OctoLong, a context engineering pipeline that instruments an AST parser, a language server backend, and a package manager to facilitate the recursive retrieval of code references, enabling the curation of dependency-rich code contexts of millions of tokens in length. We then train OctoLong-Instruct, a suite of capable long-context open LMs, derived from base models ranging in size from 600M to 14B parameters, via cont
使用跨仓库代码上下文提高长上下文建模能力。
- 核心方法
- 通过 AST 解析器、语言服务器后端和包管理器实现代码引用的递归检索,创建依赖关系丰富的代码上下文并训练 OctoLong-Instruct 模型。
- 适合谁读
- 研究者 / 工程师
- 要解决的问题
- 现有的长上下文语料库资源有限,特别是在长距离依赖方面。
- 关键实验
- 未提供
- 主要贡献
- 引入了 OctoLong 上下文工程管道和 OctoLong-Instruct 长上下文开放模型套件。
- 意义与局限
- 该方法可以显著增强模型处理长上下文的能力,尤其适用于代码理解和生成任务,但可能需要大量计算资源。