{"id":37061455,"url":"https://github.com/dhruvdcoder/xlm-core","last_synced_at":"2026-02-21T02:00:59.417Z","repository":{"id":326995710,"uuid":"1069459319","full_name":"dhruvdcoder/xlm-core","owner":"dhruvdcoder","description":"XLM is a modular, research-friendly framework for developing and comparing non-autoregressive language models. Built on PyTorch and PyTorch Lightning, with Hydra for configuration management, XLM makes it effortless to experiment with cutting-edge NAR architectures.","archived":false,"fork":false,"pushed_at":"2026-02-13T23:45:26.000Z","size":6453,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T05:31:35.741Z","etag":null,"topics":["diffusion-models","non-autoregressive-generation","small-language-models"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhruvdcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T01:29:20.000Z","updated_at":"2026-02-13T23:45:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dhruvdcoder/xlm-core","commit_stats":null,"previous_names":["dhruvdcoder/xlm-core"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dhruvdcoder/xlm-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdcoder%2Fxlm-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdcoder%2Fxlm-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdcoder%2Fxlm-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdcoder%2Fxlm-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruvdcoder","download_url":"https://codeload.github.com/dhruvdcoder/xlm-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdcoder%2Fxlm-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion-models","non-autoregressive-generation","small-language-models"],"created_at":"2026-01-14T06:57:32.077Z","updated_at":"2026-02-21T02:00:59.405Z","avatar_url":"https://github.com/dhruvdcoder.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/xLM_bold.png\" width=\"180\" alt=\"XLM Logo\"/\u003e\n\u003c/p\u003e\n\n\u003c!-- \u003ch1 align=\"center\"\u003eXLM\u003c/h1\u003e --\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA Unified Framework for Non-Autoregressive Language Models\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/xlm-core/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/xlm-core?color=blue\u0026label=PyPI\" alt=\"PyPI version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/dhruvdcoder/xlm-core\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-3.11+-green.svg\" alt=\"Python 3.11+\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/dhruvdcoder/xlm-core/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nXLM is a **modular, research-friendly framework** for developing and comparing non-autoregressive language models. Built on PyTorch and PyTorch Lightning, with Hydra for configuration management, XLM makes it effortless to experiment with cutting-edge NAR architectures.\n\n## ✨ Key Features\n\n| Feature                       | Description                                                                           |\n|-------------------------------|---------------------------------------------------------------------------------------|\n| 🧩 **Modular Design**         | Plug-and-play components—swap models, losses, predictors, and collators independently |\n| ⚡ **Lightning-Powered**       | Distributed training, mixed precision, and logging out of the box                     |\n| 🎛️ **Hydra Configs**          | Hierarchical configuration with runtime overrides—no code changes needed              |\n| 📦 **Multiple Architectures** | 7 NAR model families ready to use                                                     |\n| 🔬 **Research-First**         | Type-safe with `jaxtyping`, debug modes, and flexible metric injection                |\n| 🤗 **Hub Integration**        | Push trained models directly to Hugging Face Hub                                      |\n\n## 🏗️ Available Models\n\n| Model  | Full Name                | Description                          |\n|--------|--------------------------|--------------------------------------|\n| `mlm`  | Masked Language Model    | Classic BERT-style masked prediction |\n| `ilm`  | Insertion Language Model | Iterative insertion-based generation |\n| `arlm` | Autoregressive LM        | Standard left-to-right baseline      |\n| `mdlm` | Masked Diffusion LM      | Discrete diffusion with masking      |\n| `idlm` | Diffusion Insertion LM   | Multi-token insertion diffusion      |\n\n## 🚀 Installation\n\n```bash\npip install xlm-core\n```\n\nFor model implementations, also install:\n\n```bash\npip install xlm-models\n```\n\n## 📖 Quick Start\n\nXLM uses a simple CLI with three main arguments:\n\n```bash\nxlm job_type=\u003cJOB\u003e job_name=\u003cNAME\u003e experiment=\u003cCONFIG\u003e\n```\n\n| Argument     | Description                                           |\n|--------------|-------------------------------------------------------|\n| `job_type`   | One of `prepare_data`, `train`, `eval`, or `generate` |\n| `job_name`   | A descriptive name for your run                       |\n| `experiment` | Path to your Hydra experiment config                  |\n\n## 🎯 Example: ILM on LM1B\n\nA complete workflow demonstrating the Insertion Language Model on the LM1B dataset:\n\n### 1️⃣ Prepare Data\n\n```bash\nxlm job_type=prepare_data job_name=lm1b_prepare experiment=lm1b_ilm\n```\n\n### 2️⃣ Train\n\n```bash\n# Quick debug run (overfit a single batch)\nxlm job_type=train job_name=lm1b_ilm experiment=lm1b_ilm debug=overfit\n\n# Full training\nxlm job_type=train job_name=lm1b_ilm experiment=lm1b_ilm\n```\n\n### 3️⃣ Evaluate\n\n```bash\nxlm job_type=eval job_name=lm1b_ilm experiment=lm1b_ilm \\\n    +eval.ckpt_path=\u003cCHECKPOINT_PATH\u003e\n```\n\n### 4️⃣ Generate\n\n```bash\nxlm job_type=generate job_name=lm1b_ilm experiment=lm1b_ilm \\\n    +generation.ckpt_path=\u003cCHECKPOINT_PATH\u003e\n```\n\n**Tip:** Add `debug=[overfit,print_predictions]` to print generated samples to the console:\n\n```bash\nxlm job_type=generate job_name=lm1b_ilm experiment=lm1b_ilm \\\n    +generation.ckpt_path=\u003cCHECKPOINT_PATH\u003e \\\n    debug=[overfit,print_predictions]\n```\n\n### 5️⃣ Push to Hugging Face Hub\n\n```bash\nxlm job_type=push_to_hub job_name=lm1b_ilm_hub experiment=lm1b_ilm \\\n    +hub_checkpoint_path=\u003cCHECKPOINT_PATH\u003e \\\n    +hub.repo_id=\u003cYOUR_REPO_ID\u003e\n```\n\n## 🗂️ Project Structure\n\n```\nxlm-core/\n├── src/xlm/           # Core framework\n│   ├── harness.py     # PyTorch Lightning module\n│   ├── datamodule.py  # Data loading \u0026 collation\n│   ├── metrics.py     # Evaluation metrics\n│   └── configs/       # Default Hydra configs\n│\n└── xlm-models/        # Model implementations\n    ├── mlm/           # Masked LM\n    ├── ilm/           # Infilling LM\n    ├── arlm/          # Autoregressive LM\n    └── ...            # Other architectures\n```\n\n## 🔧 Extending XLM\n\nAdding a new model requires implementing four components:\n\n| Component     | Responsibility              |\n|---------------|-----------------------------|\n| **Model**     | Neural network architecture |\n| **Loss**      | Training objective          |\n| **Predictor** | Inference/generation logic  |\n| **Collator**  | Batch preparation           |\n\n\nYou can also add new entrypoint scripts to the cli.\n\nSee the [Contributing Guide](./wiki/CONTRIBUTING.md) for a complete walkthrough.\n\n## 📚 Documentation\n\n- [Data Pipeline](./wiki/datapipeline.md) – How data flows through XLM\n- [Training Scripts](./wiki/scripts/training.md) – Advanced training options\n- [Generation](./wiki/scripts/generation.md) – Decoding strategies and parameters\n- [External Models](./wiki/EXTERNAL_MODELS.md) – Using pretrained weights\n\n## 🤝 Contributing\n\nWe welcome model contributions! Please check out our [Contributing Guide](./wiki/CONTRIBUTING.md) for guidelines on adding new models and features.\n\n## 📄 License\n\nThis project is licensed under the MIT License.\n\n## 🙏 Acknowledgements\n\nXLM is developed and maintained by [IESL](https://iesl.cs.umass.edu/) students at UMass Amherst.\n\n**Primary Developers:**\n\n1. [Dhruvesh Patel](https://dhruveshp.com) \n2. [Durga Prasad Maram](https://github.com/Durga-Prasad1)\n3. [Sai Sreenivas Chintha](https://github.com/sensai99) \n4. [Benjamin Rozonoyer](https://brozonoyer.github.io/)\n\n**Model Contributors:**\n1. Soumitra Das (EditFlow)\n2. Eric Chen (EditFlow)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt with ❤️ for the NLP research community\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvdcoder%2Fxlm-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruvdcoder%2Fxlm-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvdcoder%2Fxlm-core/lists"}