Research map / Architectures and efficiency / Attention and transformers
LongCoder: A Long-Range Pre-trained Language Model for Code Completion
Daya Guo, Canwen Xu, Nan Duan, Jian Yin, Julian McAuley
Sun Yat-sen University · Microsoft Research Asia · University of California, San Diego
Read the paperPlace an idea next to itCheck your own paper ↗
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add memory tokens (global attention to import/class/function statements) (ablation) | LongCoder · LCC Python/Java/C# | EM: Python 17.61 -> 16.80 when removed; Java 25.96 -> 24.87; C# 31.22 -> 30.16 when removed | Improved |
| add bridge tokens (ablation) | LongCoder · LCC Python/Java/C# | Edit Sim: Python 54.82 -> 51.92 when removed; Java 60.81 -> 57.48; C# 64.18 -> 59.09 | Improved |
| use out-of-window context (full long context) instead of last 512 tokens (ablation) | LongCoder · LCC Python/Java/C# | EM: Python 17.61 -> 16.66 when restricted to 512-token window | Improved |
| selecting memory tokens every 64 tokens instead of statement-based global tokens (ablation) | LongCoder · LCC Python | EM: 17.61 -> 17.16 | Hurt |
| sparse window+bridge+memory attention initialized from UniXcoder vs UniXcoder full attention | LongCoder · LCC Python/Java/C# | EM: Python 16.55 -> 17.88; Java 23.93 -> 26.42; C# 27.97 -> 31.34 | Improved |
| sparse attention (LongCoder) vs UniXcoder on CodeXGLUE | LongCoder · PY150 and JavaCorpus | EM: PY150 43.12 -> 43.77; JavaCorpus 32.90 -> 33.13 | Improved |
| sparse attention (LongCoder) vs UniXcoder on RepoBench XF-R | LongCoder · RepoBench XF-R Python and Java | EM: Python 18.0 -> 21.4; Java 16.5 -> 19.7 | Improved |
| pre-training on CodeSearchNet with next-token prediction (ablation) | LongCoder · LCC Python/Java/C# | EM: Python 17.61 -> 17.88; Java 25.96 -> 26.42; C# 31.22 -> 31.34 | Improved |
Later papers that compared with this method
1 later accepted paper reports LongCoder as a baseline in their results tables; 1 of them report a better number on most of the results they share with it.
- From Logical to Computational Sparsity: Structure-Aware Block-Sparse Attention for Long-Code Completion (ACL 2026 · better on 4 of 4 shared results)
Earlier methods this paper compares with
Named baselines from earlier accepted papers in this paper's results tables: better than 1 of 1 on most shared results.
- BigBird — Big Bird: Transformers for Longer Sequences (NeurIPS 2020) · better on 1 of 1 shared result
Matched by method name in results tables read by AI. Authors' own tables tend to favour the newer method, and a comparison can be missed when a method is renamed.
Open problems in efficient language transformers
Which efficient transformer designs keep their quality, speed and memory gains at larger scale and in more languages?
- Experiments stop at small models, often 1B parameters or fewer. · 10 papers state it
- The method is slower or heavier than its baseline in training or inference. · 10 papers state it
- Only English or alphabetic languages were tested. · 9 papers state it
Closest papers by meaning
- From Logical to Computational Sparsity: Structure-Aware Block-Sparse Attention for Long-Code Completion (ACL 2026 · similarity 0.91)
- CodeT5+: Open Code Large Language Models for Code Understanding and Generation (EMNLP 2023 · similarity 0.89)
- OpenCoder: The Open Cookbook for Top-Tier Code Large Language Models (ACL 2025 · similarity 0.88)
- Structured Packing in LLM Training Improves Long Context Utilization (AAAI 2025 · similarity 0.87)
- Repoformer: Selective Retrieval for Repository-Level Code Completion (ICML 2024 · similarity 0.87)
- AlchemistCoder: Harmonizing and Eliciting Code Capability by Hindsight Tuning on Multi-source Data (NeurIPS 2024 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.