Text Generation
Transformers
Safetensors
English
pig
feature-extraction
diffusion-language-model
masked-diffusion
parallel-decoding
llada
conversational
custom_code
Run this model with HF Jobs
Run UT-IFML/LLaDA-8B-Instruct-PIG on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/UT-IFML/LLaDA-8B-Instruct-PIG. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/UT-IFML/LLaDA-8B-Instruct-PIG on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/UT-IFML/LLaDA-8B-Instruct-PIG. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/UT-IFML/LLaDA-8B-Instruct-PIG. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use UT-IFML/LLaDA-8B-Instruct-PIG with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UT-IFML/LLaDA-8B-Instruct-PIG with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="UT-IFML/LLaDA-8B-Instruct-PIG", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("UT-IFML/LLaDA-8B-Instruct-PIG", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use UT-IFML/LLaDA-8B-Instruct-PIG with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "UT-IFML/LLaDA-8B-Instruct-PIG" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UT-IFML/LLaDA-8B-Instruct-PIG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/UT-IFML/LLaDA-8B-Instruct-PIG
- SGLang
How to use UT-IFML/LLaDA-8B-Instruct-PIG 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 "UT-IFML/LLaDA-8B-Instruct-PIG" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UT-IFML/LLaDA-8B-Instruct-PIG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "UT-IFML/LLaDA-8B-Instruct-PIG" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UT-IFML/LLaDA-8B-Instruct-PIG", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use UT-IFML/LLaDA-8B-Instruct-PIG with Docker Model Runner:
docker model run hf.co/UT-IFML/LLaDA-8B-Instruct-PIG
PIG adapter, calibration tables and model card (arXiv v1 release)
Browse filesFiles changed (4)
- README.mdAdded+196
- fde.safetensorsAdded+3
- flip_confidence.npzAdded+3
- flip_entropy.npzAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196---license: mitbase_model: GSAI-ML/LLaDA-8B-Instructbase_model_relation: adapterpipeline_tag: text-generationinference: falselanguage:- entags:- diffusion-language-model- masked-diffusion- parallel-decoding- llada- pig---
# PIG adapter for LLaDA-8B-Instruct
The trained components of **Parallel Inconsistency Guidance (PIG)** for[LLaDA-8B-Instruct](https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct): a ~2.2M-parameter adapter thatpredicts, from the one forward pass the decoder already runs, how committing any masked position would changethe backbone's uncertainty at every other masked position, and two calibration tables that turn thosepredictions into the probability that a parallel commit disagrees with sequential decoding. The PIG.INT andPIG.EXT decoders read them to decide how many positions to commit per forward pass, and extendLLaDA-8B-Instruct's accuracy–throughput frontier over confidence-threshold decoding (Fast-dLLM) on GSM8K,MATH-500, MBPP and HumanEval.
This repository holds the artefacts only. The decoders, the evaluation harness and the paper's operating pointsare in the code repository, which downloads these files and the backbone itself.
**Paper:** *PIG: Parallel Inconsistency Guidance for Accelerating Diffusion Language Models* — Quentin Fruytier,Anton Xue, Sanjay Shakkottai, Sujay Sanghavi (The University of Texas at Austin), 2026. arXiv link to follow. **Code:** https://github.com/Quentin-Fruytier/PIG-DLM-release **Companion:** [UT-IFML/Nemotron-Labs-Diffusion-3B-PIG](https://huggingface.co/UT-IFML/Nemotron-Labs-Diffusion-3B-PIG),the same two components fitted for Nemotron-Labs-Diffusion-3B.
## Files
| file | what it is | size ||---|---|---|| `fde.safetensors` | the Entropy Finite Differences Estimator (the adapter): 55 tensors, ~2.17M parameters, fp32. Header metadata records `epoch = 7` and `val_edge_corr = 0.8268`. | 8.7 MB || `flip_confidence.npz` | the mismatch table $\hat p_\nu(\nu, \hat\mu)$ read by PIG.INT: 8 confidence bins × 5 coupling bins | 3.5 kB || `flip_entropy.npz` | the mismatch table $\hat p_H(H, \hat\mu)$ read by PIG.EXT: 10 entropy bins × 5 coupling bins | 3.7 kB |
Each `.npz` holds `x_edges` (bin edges on the confidence or entropy axis), `mu_edges` (bin edges on thecoupling axis), `rates` (the empirical mismatch rate of each cell), `rows` and `flips` (the commit and mismatchcounts behind each cell), `axis` and `description`.
The backbone is not redistributed here. The code loads `GSAI-ML/LLaDA-8B-Instruct` at the pinned revision`08b83a6f` from its own repository.
## Use
Install the code repository (LLaDA needs `transformers==4.49.0` and a GPU with at least 24 GB of memory;see its README), then:
```pythonfrom huggingface_hub import snapshot_downloadfrom pig import FlipTable, PIGExt, PIGIntfrom pig.llada import Geometry, LLaDADecoder
d = snapshot_download("UT-IFML/LLaDA-8B-PIG")decoder = LLaDADecoder(f"{d}/fde.safetensors") # also fetches the backbone (GSAI-ML/LLaDA-8B-Instruct)rule = PIGInt(FlipTable.load(f"{d}/flip_confidence.npz"), phi=0.1)# or: rule = PIGExt(FlipTable.load(f"{d}/flip_entropy.npz"), theta=0.25, floor=0.8)
prompt = decoder.chat_prompt("Write a Python function that returns the n-th Fibonacci number.")tokens, forwards, _ = decoder.generate(prompt, rule, Geometry("block", 64))print(decoder.tokenizer.decode(tokens, skip_special_tokens=True))print(f"{len(tokens) / forwards:.1f} tokens per forward pass")```
`PIGInt(table, phi)` bounds the predicted single-round regret by `phi`; `PIGExt(table, theta, floor=None)`widens the round until the predicted gain of waiting exceeds `theta`, optionally refusing candidates below aconfidence `floor`. `Geometry(kind, size)` is the candidate geometry: `"full"` (the whole 256-token canvas),`"block"` or `"sliding"` with a length. The code repository's `python -m pig.evaluate` and `python -m pig.sweep`reproduce the paper's HumanEval operating points with these files.
## What the adapter predicts
For a canvas with masked positions $i, j$, the target is the directed entropy finite difference
$$\hat{\mathbf D}_{ij} \approx H_i(\mathbf x) - H_i(\mathbf x \oplus \hat x_j),$$
the change in the backbone's predictive entropy at $i$ if $j$ were committed to its current argmax. One forwardpass of the frozen backbone with $j$ committed measures a single column of this matrix exactly; the adapterreturns the whole matrix from the forward pass the decoder already runs. PIG.INT sums the magnitudes of theseedges from the accepted prefix into a coupling $\hat\mu_i$ and reads $\hat p_\nu(\nu_i, \hat\mu_i)$; PIG.EXTuses their sign to predict next-round entropies and reads $\hat p_H$ at the current and predicted entropy.
**Inputs, per canvas position, all from the frozen backbone:** the post-norm hidden state (4096-d, read by aforward hook on the final normalisation layer), the canvas token id, the attention maps of the current andprevious round (256 × 256 each), and nine scalars (entropy, confidence, top-1/top-2 margin, a decoded flag, athree-way structural class, the decode fraction $t$). The canvas length is fixed at 256.
**Architecture (~2.2M parameters):** per-position embeddings (4096 → 192 for the hidden state, 4096 → 64 for thetoken embedding, 9 → 32 for the scalars) fused by a linear layer with LayerNorm into a 192-d state; twopre-norm transformer layers over the 256 positions (six heads of 32, rotary positions, GELU feed-forward ofwidth 768), each FiLM-modulated by $t$; a pairwise attention-bias MLP on the two attention maps and thelog-distance of each pair; a directed bilinear readout $f(z_i)^\top W g(z_j)/\sqrt{96} + b_{ij}$ with separatereceiver and source maps, computed for all pairs at once. At canvas length 256 it costs about 0.6 GMAC perdecoding round, about 13 ms on a shared H100.
## Training
**States.** Training-side problems are decoded with the frozen backbone and the canvas is snapshotted every 24commits, under two policies: the model's own one-token-per-round confidence-greedy decode andconfidence-greedy-to-budget set decodes, each on the free canvas and with eligibility restricted to the leftmost64 positions. No test split of any benchmark enters the harvest.
| corpus | problems | states ||---|---|---|| GSM8K (train) | 1,111 | 9,912 || MATH (train) | 1,230 | 11,026 || OpenCoder | 1,110 | 9,983 || MBPP (train) | 270 | 3,221 || total | 3,721 | 34,142 |
Splits are by problem (hash of corpus and problem id modulo 10: 0–7 train, 8 validation, 9 internal test;27,231 / 3,468 / 3,443 states).
**Labels.** For each state, 24 single plants (the 16 most confident eligible positions and 8 drawn at random)each commit one source and re-run the backbone, giving the exact finite-difference column at every eligiblereceiver: about 3,300 labelled directed edges per state, about 111M in total. The loss is evaluated only on thislabelled block, never on the full 256 × 256 output.
**Objective.** Huber loss (δ = 0.2) on the labelled edges, unweighted; AdamW, learning rate 3e-4 with warm-upand cosine decay to 3e-5, weight decay 0.01, gradient clipping at 1.0, 16 states per optimiser step, ten epochsconfigured with selection by validation per-edge correlation. The shipped checkpoint is the epoch-7 model,validation per-edge correlation 0.827.
## Held-out quality
Pearson correlation between the exact quantity and the adapter's estimate on held-out test states of the fourevaluation benchmarks (paper, Figure 6):
| | GSM8K | MATH-500 | MBPP | HumanEval ||---|---|---|---|---|| per-edge finite difference $\hat{\mathbf D}_{ij}$ vs $\mathbf D_{ij}$ | 0.80 | 0.76 | 0.80 | 0.81 || aggregate coupling $\hat\mu_i(S)$ vs $\mu_i(S)$ | 0.95 | 0.92 | 0.97 | 0.96 || local curvature over the next 32 candidates (median over set sizes) | 0.83 | 0.81 | 0.75 | 0.88 |
The adapter under-shoots edge magnitudes (it recovers 49–59% of the exact edge mass with the correct sign) butdoes so uniformly across magnitude bins, which is why the aggregate statistics the decoders consume correlatemore tightly than the individual edges.
## The calibration tables
Neither table is a model: each is a binned average of labelled commits, frozen once and read by lookup.
**Labels.** Training-split problems from GSM8K-train and OpenCoder are decoded one token per round indecreasing confidence; every sixteenth commit, about thirty candidate sets are assembled from six samplers(confidence-greedy to a coupling cut, top-$K$ and bottom-$K$ by confidence, random sets, greedy max-edge sets,mixed sets) and each is replayed sequentially from that canvas. Every member yields one row: its confidence (orentropy), its aggregate coupling to the members ahead of it, and whether the parallel commit survived thereplay.
| table | rows (commits) | mismatches | problems | row axis bins ||---|---|---|---|---|| `flip_confidence.npz` | 792,841 | 268,849 | 256 (128 per corpus) | 0, 0.2, 0.4, 0.6, 0.7, 0.8, 0.9, 0.95, 1 || `flip_entropy.npz` | 395,854 | 132,943 | 128 (64 per corpus) | 0, 0.1, 0.25, 0.5, 1, 1.75, 2.5, 3.5, 4.5, 6, ∞ (nats) |
The five coupling bins are cut at the 20th, 40th, 60th and 80th percentiles of the positive couplings seen in theprobe, with the top edge at the 99.9th percentile (`mu_edges`); a cell holding fewer than 50 commits falls backto the pooled rate of its row. The cell value is the raw mismatch frequency, with no smoothing or parametric fit.Held out by problem, the entropy table has a calibration slope of 1.02 (Brier 0.148) and the confidence table aBrier score of 0.137 on the same rows. Audited during live decoding on the paper's frontier runs, theconfidence table's realized-over-predicted mismatch ratio is 0.83–0.92 per benchmark (it errs on theconservative side); the entropy table's deferred estimate is calibrated above about 5% but under-predicts inits tail, where it predicts below 1% and 1–7% of window tokens still change.
## Intended use and caveats
- The adapter and the tables are fitted to this backbone at the pinned revision. A different checkpoint, or a different adapter, needs refitted tables: the coupling bins are quantiles of this adapter's own predictions.- The tables were fitted on free-canvas states and are applied unchanged at every block geometry in the paper; that transfer is assumed, not measured.- Greedy (argmax) decoding throughout; the reference the decoders match is greedy sequential decoding.- These are research artefacts for accelerating LLaDA-8B-Instruct. They add no safety tuning and inherit the backbone's behaviour and limitations.
## License
The files in this repository are released under the MIT License. LLaDA-8B-Instruct is released by its authorsunder the MIT License and is not redistributed here.
## Citation
```bibtex@misc{fruytier2026pig, title = {{PIG}: Parallel Inconsistency Guidance for Accelerating Diffusion Language Models}, author = {Fruytier, Quentin and Xue, Anton and Shakkottai, Sanjay and Sanghavi, Sujay}, year = {2026}, note = {arXiv preprint; identifier to follow}}```123version https://git-lfs.github.com/spec/v1oid sha256:6ab1ce7ca667c277971fe310254a64801796d489edb35701138f74c609c5dfafsize 8666764123version https://git-lfs.github.com/spec/v1oid sha256:87c1ffc525edd34c323e025f128a6cd1a88ec607315016f9da14823d05068cbesize 3486123version https://git-lfs.github.com/spec/v1oid sha256:ff3f5c0cdf37646b8cc67818d634e0e6bd94fb79ca5094e4eb602a3c6ad52511size 3718README.mdAdded+196
fde.safetensorsAdded+3
flip_confidence.npzAdded+3
flip_entropy.npzAdded+3