Text Generation
Transformers
Safetensors
laguna
code
distillation
moe-to-dense
conversational
custom_code
Instructions to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "poolside-laguna-hackathon/laguna-xs2-dense-stage2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
- SGLang
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 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 "poolside-laguna-hackathon/laguna-xs2-dense-stage2" \ --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": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "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 "poolside-laguna-hackathon/laguna-xs2-dense-stage2" \ --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": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Docker Model Runner:
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -55,24 +55,23 @@ print(tok.decode(m.generate(**ids, max_new_tokens=64)[0], skip_special_tokens=Tr
|
|
| 55 |
|
| 56 |
## Results
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|---|---|---|---|
|
| 60 |
-
| Teacher (Laguna XS.2, fp8) | 33B (3B active) | ≈4.4 | _running_ |
|
| 61 |
-
| [Stage-1 dense](https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage1) | ≈3B | ≈25 | 0.0% (0/164) |
|
| 62 |
-
| **Stage-2 dense (this)** | ≈3B | _tbd_ | **0.6%** (1/164) |
|
| 63 |
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
-
- **Stage-2:** *valid* Python with the correct function structure, but stuck in a loop — `return 0` repeated.
|
| 74 |
|
| 75 |
-
|
| 76 |
|
| 77 |
## VRAM / footprint
|
| 78 |
|
|
|
|
| 55 |
|
| 56 |
## Results
|
| 57 |
|
| 58 |
+
HumanEval pass@1 (greedy, [evalplus](https://github.com/evalplus/evalplus)), base / plus:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
| Model | Params (resident) | PPL | HumanEval (raw completion) | HumanEval (chat template) |
|
| 61 |
+
|---|---|---|---|---|
|
| 62 |
+
| Teacher (Laguna XS.2, fp8) | 33B (3B active) | ≈4.4 | — | **88.4% / 84.8%** |
|
| 63 |
+
| [Stage-1 dense](https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage1) | ≈3B | ≈25 | 0.0% | 0.0% |
|
| 64 |
+
| **Stage-2 dense (this)** | ≈3B | — | 0.6% | 0.0% |
|
| 65 |
|
| 66 |
+
## Diagnosis & next steps (honest)
|
| 67 |
|
| 68 |
+
The dense models are **near-zero on HumanEval in *both* eval formats** — i.e. genuinely **not yet usable**, not just an eval artifact. The teacher scores a normal **88.4%** with its chat template, so the harness is sound and the eval format matters a lot (raw completion is off-distribution for this instruct model).
|
| 69 |
|
| 70 |
+
**Root cause:** XS.2 is an **instruct/agentic** model (chat template, special tokens, EOS-terminated turns), but we distilled it on **raw concatenated pretraining text** (DCLM + code, packed). That pushed the student off its instruct distribution and it never learned to *stop* — so generations degenerate (Stage-1: `return n;` repeated; Stage-2 in chat mode: control-token spam `</think>…</assistant>`). The ≈14M-token KD budget is also 20–400× below typical recovery budgets.
|
| 71 |
|
| 72 |
+
**Fix (the real next step):** distill in the model's **native chat format** — coding instruction→response conversations rendered through `chat_template.jinja`, EOS-terminated, ideally with teacher-generated responses (so we match the teacher's actual operating distribution). Same KD loss/loop; only the data + tokenization change. More *raw* tokens would not fix this.
|
|
|
|
| 73 |
|
| 74 |
+
What this release **does** demonstrate: the MoE→dense **architecture** works (per-layer init converges, see the NMSE curves) and the **≈11× weight-VRAM reduction** (below) at matched active-compute. Task accuracy awaits the chat-format KD run.
|
| 75 |
|
| 76 |
## VRAM / footprint
|
| 77 |
|