Instructions to use legesher/language-decoded-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use legesher/language-decoded-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="legesher/language-decoded-lora", device_map="auto")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("legesher/language-decoded-lora", dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use legesher/language-decoded-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "legesher/language-decoded-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "legesher/language-decoded-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/legesher/language-decoded-lora
- SGLang
How to use legesher/language-decoded-lora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "legesher/language-decoded-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "legesher/language-decoded-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "legesher/language-decoded-lora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "legesher/language-decoded-lora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio
How to use legesher/language-decoded-lora with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for legesher/language-decoded-lora to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for legesher/language-decoded-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for legesher/language-decoded-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="legesher/language-decoded-lora", max_seq_length=2048, ) - Docker Model Runner
How to use legesher/language-decoded-lora with Docker Model Runner:
docker model run hf.co/legesher/language-decoded-lora
license: apache-2.0
language:
- en
- zh
- es
- ur
tags:
- lora
- aya
- tiny-aya
- multilingual
- code
- legesher
- tiny-aya-expedition
- language-decoded
- unsloth
library_name: transformers
base_model:
- CohereLabs/tiny-aya-base
pipeline_tag: text-generation
Language Decoded LoRA
QLoRA adapters fine-tuned on multilingual code conditions for the Language Decoded project (part of Cohere's Tiny Aya Expedition).
Submitted paper title (2026-05-26): Language, Decoded: Exploring the Impact of Fine-Tuning a Multilingual Model on Native-Language Code
β οΈ Phase 3 eval numbers β read the experiments repo before citing
Original Phase 3 _summary_*.json files on legesher/language-decoded-experiments under-report cond-5 SIB-200 accuracy by 20β35pp because the strict inference-time extractor refused native-script answers. Cite the _summary_reparsed_*.json siblings (refined extractor) instead. Five Phase 3 SIB-200 conclusions also flip winβloss against baseline once the extractor is corrected (cond-2-es-5k, cond-2-es-20k, cond-2-ur-20k, cond-2-zh-20k, cond-3-zh-5k), and cond-2-ur-5k's gain deflates 4.4Γ. See the banner on the experiments repo (top of the README) for the full picture.
Research Question
How does fine-tuning Tiny Aya on non-English code β whether transpiled, mixed-native, or fully translated β affect its multilingual reasoning and instruction-following, and how does that impact differ from fine-tuning on English code?
The hypothesis is not that non-English code matches or exceeds English code as a generic reasoning aid β rather, that the kind of effect non-English code produces depends on the target language, the data structure, and how the corpus was constructed. See legesher/language-decoded-experiments for the full project context.
Base Model
All adapters are trained on CohereLabs/tiny-aya-base (3.35B parameters). Tiny Aya was chosen because it is small (deployable on a single 16 GB T4 GPU via QLoRA), accessible (Apache 2.0-licensed), and supports 70+ languages with explicit emphasis on lower-resourced ones β which makes the experimental ladder viable for ur at all.
Adapter Inventory
Each subdirectory is one trained condition Γ file-volume Γ seed combination. All adapters share the QLoRA hyperparameters listed under Training Details.
| Subdirectory | Condition | Training data | Seeds |
|---|---|---|---|
condition-1-en-5k-seed{42,123,456}/ |
1 | Raw English Python from bigcode/the-stack-v2-dedup (5k file subset) |
42, 123, 456 |
condition-1-en-20k-seed42/ |
1 | Raw English Python (20k file subset) | 42 |
condition-2-{zh,es,ur}-5k-seed{42,123,456}/ |
2 | The same 5k subset as cond-1, processed through Legesher v0.7.3 β Python's reserved words (keywords, exceptions, built-in functions, numerical system for some target languages) translated to the target language; user logic preserved | 42, 123, 456 |
condition-2-{zh,es,ur}-20k-seed42/ |
2 | The same 20k subset as cond-1, processed through Legesher v0.7.3 | 42 |
condition-3-zh-5k-native-code-seed42/ |
3 | Community-collected raw Chinese code from varied online public-source repositories (different source-file population from cond-1/2/5 by design) | 42 |
condition-5-{zh,es,ur}-5k-c4ai-aya-expanse-32b-seed42/ |
5 | The same 5k subset as cond-1, first transpiled by Legesher v0.7.3 to translate Python's reserved words, then run through c4ai-aya-expanse-32b via the Cohere API to translate the remaining content (identifiers, comments, docstrings, string literals) |
42 |
Condition 4 ("Community-Contributed Native Code") is pending sufficient direct community contributions to the legesher/legesher-native-code HF Space; no cond-4 adapter exists yet.
Source-file control
Cond-1, cond-2, and cond-5 all train on the same 5,000-file subset drawn from bigcode/the-stack-v2-dedup (with a parallel 20k subset for the 20k tier). Differences across these conditions reflect the processing pipeline (raw / transpiled / fully translated), not file-quality or content drift. Cond-3 is the deliberate exception β its source files are a different population by design.
The experimental ladder
- Baseline β cond-1: Does code help at all? (Replicates Aryabumi et al., 2024.)
- Cond-1 β cond-2: Does translating Python's reserved words (keywords, exceptions, built-in functions, numerical system for some target languages) into the target language change the model's behavior? User logic and library calls remain English-derived.
- Cond-2 β cond-3: Does code pulled from real-world public-source repositories β code humans actually wrote in or with the target language β add value beyond Legesher's mechanical translation?
- Cond-2 β cond-5: Cond-2 translates only Python's reserved words; cond-5 goes further by translating the rest of the file's content (identifiers, comments, docstrings, string literals) via
c4ai-aya-expanse-32b. Logic and structure are preserved. - Cond-3 β cond-5 (implicit): Human-authored vs. machine-synthesized native code.
For the full ladder including future directions (natural-language text control, combined-language training, similar-script evaluation), see legesher/language-decoded-experiments.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-base")
tokenizer = AutoTokenizer.from_pretrained("CohereLabs/tiny-aya-base")
# Load a LoRA adapter β e.g., cond-1 (English code, seed 42, 5k tier)
model = PeftModel.from_pretrained(
base_model,
"legesher/language-decoded-lora",
subfolder="condition-1-en-5k-seed42",
)
# Or a language-specific cond-2 adapter (Chinese reserved-word translation, seed 42)
model = PeftModel.from_pretrained(
base_model,
"legesher/language-decoded-lora",
subfolder="condition-2-zh-5k-seed42",
)
# Or a cond-5 adapter (Synthesized Native Code, Urdu, seed 42)
model = PeftModel.from_pretrained(
base_model,
"legesher/language-decoded-lora",
subfolder="condition-5-ur-5k-c4ai-aya-expanse-32b-seed42",
)
Training Details
| Parameter | Value |
|---|---|
| Base model | CohereLabs/tiny-aya-base (3.35B params, 70+ languages, low-resource emphasis) |
| Method | QLoRA 4-bit (NF4), ~5.4 GB VRAM, Unsloth-accelerated |
| Hardware | Kaggle T4 (16 GB) |
| Tokenizer | CohereLabs/tiny-aya-base |
| Transpilation tool | Legesher v0.7.3 (Phase 3); v0.5.1 / v0.6.0 used in Phase 2 |
| Cond-5 translation | c4ai-aya-expanse-32b accessed via the Cohere API (made possible by Cohere credits awarded to Legesher) |
| Training data | legesher/language-decoded-data |
QLoRA hyperparameters
| Parameter | Value |
|---|---|
LoRA rank (r) |
16 |
| LoRA alpha | 32 |
| LoRA dropout | 0.0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, up_proj, down_proj, gate_proj |
| Bias | none |
| Task type | CAUSAL_LM |
| PEFT version | 0.18.1 |
| Quantization | NF4 (4-bit) via Unsloth |
Evaluation
Phase 3 models are evaluated on four multilingual benchmarks under template1 (English-prompt) and template2 (native-prompt) across the full data_lang Γ instr_lang matrix:
| Benchmark | What it measures | Examples per language |
|---|---|---|
| XNLI | Natural-language inference | ~5,000 |
| X-CSQA | Commonsense reasoning | ~1,000 |
| SIB-200 | Topic classification | ~204 |
| Belebele | Reading comprehension | ~900 |
MGSM was used in Phase 2 and dropped from Phase 3 β at 3.35B parameters and 250 examples per language, scores ranged 2.8% β 10.8% across all conditions with most condition-to-condition differences within noise. A useful null result; budget was reallocated to SIB-200 and Belebele.
Paper-grade evaluation results live on legesher/language-decoded-experiments β see the refined-tables and the writeup at expedition-tiny-aya/analysis/phase-3/phase3-refined-evaluation.md.
Limitations
- Single base model: All adapters are trained on
CohereLabs/tiny-aya-base(3.35B params). Results may not generalize to larger or architecturally different models. Future iterations will expand to additional base models. - Per-language fine-tuning only: Every condition is per-language β each
cond-2-{zh,es,ur}-5k(andcond-5-{zh,es,ur}-5k) is a separate training run. Combined-language training is a planned future condition. - Limited training data: 5k and 20k file tiers are constrained by Kaggle T4 hardware limits. 103k variants exist on the training data repo but no 103k adapters have been trained yet.
- Consumer hardware: Training on Kaggle T4 (16 GB) with 4-bit quantization introduces approximation that may affect adapter quality compared to full-precision training.
- Extractor coverage β when citing Phase 3 results, use the refined-extractor scores. See the banner at the top of this card and the experiments repo for full details.
Related Resources
- Experiment tracking and results: legesher/language-decoded-experiments (canonical project source-of-truth)
- Training data: legesher/language-decoded-data
- Community native code: legesher/language-decoded-community
- Cond-4 contribution interface:
legesher/legesher-native-codeHF Space - Transpilation tool: Legesher on GitHub
Citation
@misc{language-decoded-2026,
title={Language Decoded: Exploring the Impact of Native Code on Multilingual Models},
author={Madison Edgar and Saad Ahmed Bazaz and Tom Sherborne and Rashik Shahjahan and Khojasteh Mirza and Sarah Jawaid and Rafay Mustafa and Sohaib Ahmed Bazaz},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/legesher/language-decoded-lora}
}
License
Apache 2.0