Instructions to use modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126") model = AutoModelForCausalLM.from_pretrained("modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126
- SGLang
How to use modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126 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 "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126" \ --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": "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126", "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 "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126" \ --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": "modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126 with Docker Model Runner:
docker model run hf.co/modelcollapse/gemma-3-270m-it-cpt-annealing-sft-251126
license: gemma
datasets:
- lianghsun/tw-instruct-500k-rephrase
language:
- zh
- en
base_model:
- lianghsun/gemma-3-270m-tw
library_name: transformers
tags:
- Taiwan
- ROC
- zhtw
- chat
- Twinkle.AI
metrics:
- perplexity
π§ͺ Model Behavior Incident Log
Collapse Symptoms After Annealing + SFT (Gemma-3-270M-TW)
This incident report documents multiple unexpected behaviors observed during the following pipeline:
- Gemma-3-270M (base) β CPT β Dialogue-Annealing β SFT
- Training performed with LLaMA-Factory on multiple Traditional Chinese datasets.
The purpose of this log is to document:
- what happened
- why the model collapsed
- representative failure outputs
- suspected root causes
- mitigation steps and future plans
π Summary of the Incident
After the stage CPT β Phase-3 Dialogue Annealing β SFT, the model displayed severe conversational degradation, including:
- repetitive loops
- meaningless vocalization (e.g.,
hihihihi...) - empty or nearly empty responses
- echoing the user query
- hallucinated list expansions
- loss of chat-template consistency
- collapse-like distribution drift
These issues did not appear in earlier checkpoints (e.g., CPT β SFT without annealing).
π Representative Failure Outputs
1. Character-level repetition
Prompt:
hi
Output:
hihihihihihihihihihihihihihihi...
2. Garbled symbols / noise
Prompt:
δ½ ε₯½
Output:
ηΈ½οΌοΌγοΌγοΌγοΌγ!βοΌγοΌβοΌβοΌγ!βγ!β
3. Semantic drift + self-looping
Prompt:
εηη©εε
¬εΌ
Output:
ζ―δ»ιΊΌοΌ
ζοΌδ»ει½ζ―ι£εγ
δ½ ει½ ζ―ι£εγ
ζ ιζ―ε¨ι£ε裑ι οΌ
ζδ»₯οΌζ²δΊοΌζ²ζοΌζ²δΊγγ
ζδΉδΈη₯ιγ
ζη₯ιγ
η₯ιγ
η₯ιδΊγ
4. Query echoing + hallucinated QA scaffolding
Prompt:
θ«η¨δΈε₯θ©±θ§£ιε°ηηΊδ»ιΊΌζθͺθ½γ
Output:
θ«η¨δΈε₯θ©±θ§£ιε°ηηΊδ»ιΊΌζθͺθ½γ
- ζ Ήζη©ηεΈοΌδ»ιΊΌζ―γζ°£ι«γοΌ
- δ»ιΊΌζ―γη£ε ΄γοΌ
5. Baseline sanity check (pre-annealing) behaves normally
Prompt:
δ½ ε₯½ιΏ
Earlier output:
δ½ ε₯½οΌεΎι«θθ½εδ½ δΈθ΅·δΊ€ζ΅οΌζζ―ε°η£ε€§θͺθ¨ζ¨‘ε Formosa-1...
π§ Suspected Root Causes
1. Annealing Dataset Format Drift
Use of raw:
user: ...
assistant: ...
instead of structured JSON messages.
2. Overwriting Instruction Alignment
Annealing is fragile for 270M models β possible distribution collapse.
3. SFT Unable to Recover
Loss decreased, but entropy collapse persisted.
π Actions Taken
- Rebuilt CPT dataset (2.4M samples, 70/30 mix)
- Adopted stable LR tail (
cosine_with_min_lr) - Will rebuild annealing data with strict chat format
- Full SFT pipeline will be repeated after clean CPT
π Next Steps
- Complete clean CPT
- Rebuild dialogue annealing
- Annealing from min_lr β 0
- Re-run SFT
- Compare ablation paths
- Add regression tests
π§ Closing Note
Small multilingual models are extremely sensitive to formatting + LR scheduling.
This report documents the collapse event for transparency and future reproducibility.