---
title: "xLM: A Python Package for Non-Autoregressive Language Models"
description: "The authors present xLM, a Python package built on PyTorch, PyTorch Lightning and Hydra. 22 references."
authors: ["Dhruvesh Patel", "Durga Prasad Maram", "Sai Sreenivas Chintha", "Benjamin Rozonoyer", "Andrew McCallum"]
year: 2026
venue: "Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 3: System Demonstrations)"
source: "https://aclanthology.org/2026.eacl-demo.31/"
doi: "10.18653/v1/2026.eacl-demo.31"
licence: "CC BY 4.0 (ACL Anthology)"
licence_url: "https://creativecommons.org/licenses/by/4.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/patel-2026-xlm-python-package-non-autoregressive/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/patel-2026-xlm-python-package-non-autoregressive/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2026](https://md.research.elamur.ai/free/en/papers/2026/page/48/) / xLM: A Python Package for Non-Autoregressive Language Models

# xLM: A Python Package for Non-Autoregressive Language Models

**Authors:** Dhruvesh Patel, Durga Prasad Maram, Sai Sreenivas Chintha, [Benjamin Rozonoyer](https://md.research.elamur.ai/free/en/authors/benjamin-rozonoyer/) and [Andrew McCallum](https://md.research.elamur.ai/free/en/authors/andrew-mccallum/) · **Year:** 2026 · **Venue:** [Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 3: System Demonstrations)](https://md.research.elamur.ai/free/en/venues/eacl/) ([EACL 2026](https://md.research.elamur.ai/free/en/venues/eacl/2026/)) · **Publisher:** [Association for Computational Linguistics](https://md.research.elamur.ai/free/en/publishers/association-for-computational-linguistics/) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

**Links:** [Publisher's page](https://aclanthology.org/2026.eacl-demo.31/) · [PDF](https://aclanthology.org/2026.eacl-demo.31.pdf) · [DOI 10.18653/v1/2026.eacl-demo.31](https://doi.org/10.18653/v1/2026.eacl-demo.31) · [OpenAlex](https://openalex.org/W7140121580)

**Citations:** 0 citations (OpenAlex, 2026-10-14)

## Summary
Research on non-autoregressive text generation is growing, including masked diffusion, Gaussian diffusion, insertion-based and edit-based language models. Unlike autoregressive LMs, these approaches lack common tooling. Most implementations are one-off, and each method needs its own collation, loss and decoding code, so fair comparisons are hard. The authors present xLM, a Python package built on PyTorch, PyTorch Lightning and Hydra. It aims to speed up prototyping of small non-autoregressive LMs.

Its design follows a "maximal independence" philosophy:
- Shared core components (Harness, DataModule) delegate model-specific work to pluggable parts.
- Each model lives in a self-contained folder that can be copied from a template.
- Hydra configs let users swap whole components without editing code.

A walkthrough shows how to build the Insertion Language Model (ILM) step by step. To check fidelity, the authors re-implement several models on star-graph planning tasks and on LM1B. Results stay close to earlier published figures. A companion package, xlm-models, is planned to provide small pre-trained models for the community.

## Key points
- **Core architecture:** a Harness (a LightningModule) holds the Model, LossFunction, Predictor and Metrics slots. A TextDataModule manages one DatasetManager per dataset, mapped many-to-many to the train/val/test/predict stages.
- **Training setups:** single-GPU, multi-GPU and multi-node, with both map-style and iterable datasets.
- **Workflows:** a single `xlm` command runs train, eval and generate jobs, plus a `debug=overfit` mode. Models are discovered through `XLM_MODELS_PACKAGES` or `XLM_MODELS_PATH`.
- **Star-graph planning benchmark (StarEasy and harder variants):** ARLM, MLM, MDLM and ILM results fall within 2% of the original papers. On the Hard variant, ILM reaches 97.5% sequence accuracy, while the other models score roughly 21–25%.
- **LM1B benchmark:** 12-layer ARLM, MDLM and ILM models are scored by negative log-likelihood under Llama 3.2, and the outcomes are close to those reported by Patel et al. (2025). Planned extensions include edit-based models and non-text tasks such as molecule generation.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

## Institutions

- [University of Massachusetts Amherst](https://md.research.elamur.ai/free/en/universities/university-of-massachusetts-amherst/) — University, Amherst Center, United States · 106 works · 66,692 citations

📚 Shelves (4): [🖥️ Computer Science](https://md.research.elamur.ai/free/en/shelves/computer-science/) · 16,667 works · [🤖 Artificial Intelligence](https://md.research.elamur.ai/free/en/shelves/computer-science/artificial-intelligence/) · 16,194 works · [🎭 Arts and Humanities](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/) · 16,039 works · [🗣️ Language and Linguistics](https://md.research.elamur.ai/free/en/shelves/arts-and-humanities/language-and-linguistics/) · 15,891 works

🧭 Topics (1): [🧠 Language models & pretraining](https://md.research.elamur.ai/free/en/topics/language-models/) · 3,320 works

## Cite

Cite as: Dhruvesh Patel, Durga Prasad Maram, Sai Sreenivas Chintha, Benjamin Rozonoyer and Andrew McCallum. 2026. xLM: A Python Package for Non-Autoregressive Language Models. Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 3: System Demonstrations).

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{patel2026xlm,
  title = {{xLM: A Python Package for Non-Autoregressive Language Models}},
  author = {Dhruvesh Patel, Durga Prasad Maram, Sai Sreenivas Chintha, Benjamin Rozonoyer and Andrew McCallum},
  booktitle = {Proceedings of the 19th Conference of the European Chapter of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
  year = {2026},
  doi = {10.18653/v1/2026.eacl-demo.31},
  url = {https://doi.org/10.18653/v1/2026.eacl-demo.31}
}
```

- [← previous WoVis: Interactive Visualization of Word Embeddings for Semantic Change in Historical and Dialectal Language Resources](https://md.research.elamur.ai/free/en/papers/miletic-2026-wovis-interactive-visualization-word-embeddings/)
- [next → XLSR-MamBo: Scaling the Hybrid Mamba-Attention Backbone for Audio Deepfake Detection](https://md.research.elamur.ai/free/en/papers/ng-2026-xlsr-mambo-scaling-hybrid-mamba/)
- [↑ back to papers of 2026](https://md.research.elamur.ai/free/en/papers/2026/page/48/)

## References

22 references, 8 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. Gregor Bachmann and Vaishnavh Nagarajan. 2024. The pitfalls of next-token prediction. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 2296–2318. PMLR. [find](https://scholar.google.com/scholar?q=Gregor+Bachmann+and+Vaishnavh+Nagarajan%2E+2024%2E+The+pitfalls+of+next%2Dtoken+prediction%2E+In+Proceedings+of+the+41st+International+Conference+on+Machine+Learning%2C+volume+235+of+Proceedings+of+Machine+Lear)
2. Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. 2014. [One billion word benchmark for measuring progress in statistical language modeling](https://md.research.elamur.ai/free/en/papers/chelba-2013-one-billion-word-benchmark-measuring/). Preprint, arXiv:1312.3005.
3. Juechu Dong, Boyuan Feng, Driss Guessous, Yanbo Liang, and Horace He. 2024. Flex attention: A programming model for generating optimized attention kernels. Preprint, arXiv:2412.05496. [find](https://scholar.google.com/scholar?q=Juechu+Dong%2C+Boyuan+Feng%2C+Driss+Guessous%2C+Yanbo+Liang%2C+and+Horace+He%2E+2024%2E+Flex+attention%3A+A+programming+model+for+generating+optimized+attention+kernels%2E+Preprint%2C+arXiv%3A2412%2E05496%2E)
4. William Falcon and The PyTorch Lightning team. 2019. PyTorch Lightning. [find](https://scholar.google.com/scholar?q=William+Falcon+and+The+PyTorch+Lightning+team%2E+2019%2E+PyTorch+Lightning%2E)
5. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc., USA. [find](https://scholar.google.com/scholar?q=Erich+Gamma%2C+Richard+Helm%2C+Ralph+Johnson%2C+and+John+Vlissides%2E+1995%2E+Design+patterns%3A+elements+of+reusable+object%2Doriented+software%2E+Addison%2DWesley+Longman+Publishing+Co%2E%2C+Inc%2E%2C+USA%2E)
6. Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2017. [Allennlp: A deep semantic natural language processing platform](https://md.research.elamur.ai/free/en/papers/gardner-2018-allennlp-deep-semantic-natural-language/).
7. Ishaan Gulrajani and Tatsunori Hashimoto. 2023. Likelihood-based diffusion language models. In Thirty-seventh Conference on Neural Information Processing Systems. [find](https://scholar.google.com/scholar?q=Ishaan+Gulrajani+and+Tatsunori+Hashimoto%2E+2023%2E+Likelihood%2Dbased+diffusion+language+models%2E+In+Thirty%2Dseventh+Conference+on+Neural+Information+Processing+Systems%2E)
8. Marton Havasi, Brian Karrer, Itai Gat, and Ricky T. Q. Chen. 2025. Edit Flows: Flow Matching with Edit Operations. Preprint, arXiv:2506.09018. — [arXiv:2506.09018](https://arxiv.org/abs/2506.09018) [find](https://scholar.google.com/scholar?q=Marton+Havasi%2C+Brian+Karrer%2C+Itai+Gat%2C+and+Ricky+T%2E+Q%2E+Chen%2E+2025%2E+Edit+Flows%3A+Flow+Matching+with+Edit+Operations%2E+Preprint%2C+arXiv%3A2506%2E09018%2E+%E2%80%94+%5BarXiv%3A2506%2E09018%5D%28https%3A%2F%2Farxiv%2Eorg%2Fabs%2F2506%2E09018%29)
9. John J Irwin and Brian K Shoichet. 2005. Zinc- a free database of commercially available compounds for virtual screening. Journal of chemical information and modeling, 45(1):177–182. [find](https://scholar.google.com/scholar?q=John+J+Irwin+and+Brian+K+Shoichet%2E+2005%2E+Zinc%2D+a+free+database+of+commercially+available+compounds+for+virtual+screening%2E+Journal+of+chemical+information+and+modeling%2C+45%281%29%3A177%E2%80%93182%2E)
10. Jaeyeon Kim, Lee Cheuk-Kit, Carles Domingo-Enrich, Yilun Du, Sham Kakade, Timothy Ngotiaoco, Sitan Chen, and Michael Albergo. 2025. Any-Order Flexible Length Masked Diffusion. Preprint, arXiv:2509.01025. [find](https://scholar.google.com/scholar?q=Jaeyeon+Kim%2C+Lee+Cheuk%2DKit%2C+Carles+Domingo%2DEnrich%2C+Yilun+Du%2C+Sham+Kakade%2C+Timothy+Ngotiaoco%2C+Sitan+Chen%2C+and+Michael+Albergo%2E+2025%2E+Any%2DOrder+Flexible+Length+Masked+Diffusion%2E+Preprint%2C+arXiv%3A2509%2E010)
11. Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. [Efficient memory management for large language model serving with pagedattention](https://md.research.elamur.ai/free/en/papers/kwon-2023-efficient-memory-management-large-language/). In Proceedings of the ACM SIGOPS 29th Symposium on Operating Systems Principles.
12. Pengfei Li, Qichang Zheng, and Ziyi Jiang. 2025. An empirical study on the accuracy of large language models in api documentation understanding: A cross-programming language analysis. Journal of Computing Innovations and Applications, 3(2):1–14. [find](https://scholar.google.com/scholar?q=Pengfei+Li%2C+Qichang+Zheng%2C+and+Ziyi+Jiang%2E+2025%2E+An+empirical+study+on+the+accuracy+of+large+language+models+in+api+documentation+understanding%3A+A+cross%2Dprogramming+language+analysis%2E+Journal+of+Compu)
13. Lightning-AI. 2023. Litgpt. [https://github.com/](https://github.com/) Lightning-AI/litgpt. [↗](https://github.com/)
14. Team OLMo, Pete Walsh, Luca Soldaini, Dirk Groeneveld, Kyle Lo, Shane Arora, Akshita Bhagia, Yuling Gu, Shengyi Huang, Matt Jordan, Nathan Lambert, Dustin Schwenk, Oyvind Tafjord, Taira Anderson, David Atkinson, Faeze Brahman, Christopher Clark, Pradeep Dasigi, Nouha Dziri, and 21 others. 2024. 2 ol… [find](https://scholar.google.com/scholar?q=Team+OLMo%2C+Pete+Walsh%2C+Luca+Soldaini%2C+Dirk+Groeneveld%2C+Kyle+Lo%2C+Shane+Arora%2C+Akshita+Bhagia%2C+Yuling+Gu%2C+Shengyi+Huang%2C+Matt+Jordan%2C+Nathan+Lambert%2C+Dustin+Schwenk%2C+Oyvind+Tafjord%2C+Taira+Anderson%2C+Davi)
15. Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. [fairseq: A fast, extensible toolkit for sequence modeling](https://md.research.elamur.ai/free/en/papers/ott-2019-fairseq-fast-extensible-toolkit-sequence/). In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstr…
16. Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Te-jani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, and 2 others. 2019.… — [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://md.research.elamur.ai/free/en/papers/paszke-2019-pytorch-imperative-style-high-performance/)
17. Dhruvesh Patel, Aishwarya Sahoo, Avinash Amballa, Tahira Naseem, Tim GJ Rudner, and Andrew Mc-Callum. 2025. Insertion language models: Sequence generation with arbitrary-position insertions. arXiv preprint arXiv:2505.05755. — [arXiv:2505.05755](https://arxiv.org/abs/2505.05755) [find](https://scholar.google.com/scholar?q=Dhruvesh+Patel%2C+Aishwarya+Sahoo%2C+Avinash+Amballa%2C+Tahira+Naseem%2C+Tim+GJ+Rudner%2C+and+Andrew+Mc%2DCallum%2E+2025%2E+Insertion+language+models%3A+Sequence+generation+with+arbitrary%2Dposition+insertions%2E+arXiv+pre)
18. William Peebles and Saining Xie. 2023. [Scalable diffusion models with transformers](https://md.research.elamur.ai/free/en/papers/peebles-2022-scalable-diffusion-models-transformers/). In Proceedings of the IEEE/CVF international conference on computer vision, pages 4195–4205.
19. Lars Ruddigkeit, Ruud Van Deursen, Lorenz C Blum, and Jean-Louis Reymond. 2012. Enumeration of 166 billion organic small molecules in the chemical universe database gdb-17. Journal of chemical information and modeling, 52(11):2864–2875. [find](https://scholar.google.com/scholar?q=Lars+Ruddigkeit%2C+Ruud+Van+Deursen%2C+Lorenz+C+Blum%2C+and+Jean%2DLouis+Reymond%2E+2012%2E+Enumeration+of+166+billion+organic+small+molecules+in+the+chemical+universe+database+gdb%2D17%2E+Journal+of+chemical+informa)
20. Subham Sekhar Sahoo, Marianne Arriola, Aaron Gokaslan, Edgar Mariano Marroquin, Alexander M. Rush, Yair Schiff, Justin T. Chiu, and Volodymyr Kuleshov. 2024. [Simple and Effective Masked Diffusion Language Models](https://md.research.elamur.ai/free/en/papers/sahoo-2024-simple-effective-masked-diffusion-language/). In The Thirty-eighth Annual Conference on Neural Information Processing Systems.
21. Jianlin Su, Murtadha Ahmed, Yu Lu, Shengfeng Pan, Wen Bo, and Yunfeng Liu. 2024. [Roformer: Enhanced transformer with rotary position embedding](https://md.research.elamur.ai/free/en/papers/su-2021-roformer-enhanced-transformer-rotary-position/). Neurocomputing, 568:127063.
22. Leandro von Werra, Younes Belkada, Lewis Tunstall, Edward Beeching, Tristan Thrush, Nathan Lambert, Shengyi Huang, Kashif Rasul, and Quentin Gallouédec. 2020. Trl: Transformer reinforcement learning. [https://github.com/huggingface/trl](https://github.com/huggingface/trl). ) return batch A.2 [↗](https://github.com/huggingface/trl)

*Updated 1 November 2026*
