NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Narrow Transformer: Starcoder-Based Java-LM For Desktop

Kamalkumar Rathinasamy, Balaji A J, Ankush Kumar, Gagan Gayari, Harshini K, Rajab Ali Mondal, Sreenivasa Raghavan K. S, Swayam SingharXiv 2024 · DOI

Researchers at Infosys Limited have introduced NT-Java-1.1B, a "Narrow Transformer" specifically optimized for Java programming. By specializing a small-parameter model on a single language, the authors demonstrate that state-of-the-art coding assistance can be achieved without massive GPU clusters, making high-performance tools accessible on standard developer desktops.

The Case for Narrow Transformers

Modern Large Language Models (LLMs) for code are typically "jacks-of-all-trades," trained on dozens of programming languages. While impressive, this multi-lingual approach presents two major drawbacks for enterprise environments:

  1. Resource Intensity: Massive models require high-end GPUs for inference, making local deployment on developer laptops unfeasible.
  2. Diluted Proficiency: General models often lack the nuanced requirements of specific languages like Java, a cornerstone of enterprise software.

NT-Java-1.1B addresses these issues by proving that a "Narrow Transformer"—a model further trained on a specific language—can provide better performance and lower latency on consumer-grade hardware than its larger, more generic counterparts.

Methodology

The team built NT-Java-1.1B through continued pre-training of the StarCoderBase-1.1B model. The training utilized a 22B token Java-specific subset of StarCoderData (derived from The Stack v1).

Technical Architecture

  • Architecture: A decoder-only Transformer utilizing Multi-Query Attention (MQA) and FlashAttention to optimize computation speed.
  • Training Objectives: The model was trained using both Next Token Prediction (NTP) and Fill-in-the-Middle (FIM). The researchers found that FIM is mandatory for real-world IDE features like code infilling; without it, infilling performance dropped to nearly zero.
  • Post-Training Quantization: To ensure the model is "desktop-ready," it was converted to GGUF format, allowing it to run on CPU-based frameworks like Ollama and LM Studio at various precision levels (2-bit to 8-bit).

Key Results and Performance

The most striking insight from the study is that specialization can beat scale. The 1.1B parameter "Narrow" model achieved a higher score on Java benchmarks than the 3B-parameter version of the base model.

Performance comparison of NT-Java-1.1B against larger StarCoderBase models.

NT-Java-1.1B achieved a 20.2 pass@1 score on the MultiPL-E (Java) benchmark, a significant leap from the 14.2 score of the base StarCoderBase-1.1B model.

Efficiency and Democratization

By shrinking the model's footprint through quantization, the researchers have moved high-quality code models off the cloud and onto local machines. This improves data privacy and reduces operational costs.

Impact of quantization on model size and performance.

As shown above, the quantized 4-bit version (NT-Java-1.1B_Q4) occupies only 0.76 GB of RAM but still achieves a score of 15.1—outperforming the original, unquantized base model while using a fraction of the resources.

Limitations and Future Outlook

As a specialized model, NT-Java-1.1B likely experiences "catastrophic forgetting" regarding other programming languages. Additionally, because it relies on The Stack v1, it may lack the most recent Java features. However, the authors frame this as the beginning of a "family of NT Models," suggesting future specialized versions for languages like C# or Go and explorations into different model scales.

Summary updated

BibTeX
@misc{rathinasamy2024narrow,
  author = {Kamalkumar Rathinasamy and Balaji A J and Ankush Kumar and Gagan Gayari and Harshini K and Rajab Ali Mondal and Sreenivasa Raghavan K. S and Swayam Singh},
  title = {{Narrow Transformer: Starcoder-Based Java-LM For Desktop}},
  year = {2024},
  eprint = {2407.03941},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.03941},
}
Figure