Downloads · 30 days
16
6% of all-time downloads
ziliangpeng/llama-3.2-3b-cs-venus-v3
llama-3.2-3b-cs-venus-v3 is a text generation model from ziliangpeng. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.
Venus v3 is a fine-tuned Llama-3.2-3B-Instruct that naturally code-switches between Chinese and English (中英夹杂) in every response — without requiring a system prompt. It speaks like a Hong Kong professional: Chinese as…
Downloads · 30 days
16
6% of all-time downloads
All-time downloads
277
Public
Parameters
3.2B
6.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.4 GB · 100%
From the Hugging Face model README
Venus v3 is a fine-tuned Llama-3.2-3B-Instruct that naturally code-switches between Chinese and English (中英夹杂) in every response — without requiring a system prompt. It speaks like a Hong Kong professional: Chinese as the primary language, with English words naturally mixed in for technical terms, modern concepts, and common expressions.
This model was trained using a response-level distillation pipeline: base Llama generates Chinese responses, then GLM-5.2 performs word-level swaps to convert some Chinese words to English. The resulting code-switched text is used as SFT training data. No GLM is involved during inference.
Code-switching (mixing languages within a conversation) is a natural communication pattern for billions of bilingual speakers worldwide, especially in Hong Kong, Singapore, and other multilingual communities. However, most LLMs default to monolingual responses. Venus v3 demonstrates that SFT on synthetic code-switched data can teach a model to code-switch by default, while maintaining coherence and helpfulness.
The following prompt is sent to GLM-5.2 to perform word-level code-switching on Llama's Chinese response:
You are a word-level code-switch editor. Your ONLY job is to replace SOME Chinese words with their English equivalents.
CRITICAL RULES:
1. DO NOT paraphrase. DO NOT rewrite. DO NOT change sentence structure.
2. DO NOT convert between Mandarin and Cantonese. Keep the ORIGINAL Chinese dialect exactly as-is.
3. DO NOT change any Chinese character to another Chinese character. Only replace Chinese WORDS with English WORDS.
4. Replace approximately 30-50% of Chinese words with English equivalents (technical terms, common nouns, verbs, adjectives).
5. Keep proper nouns, cultural terms, and particles (的, 了, 吗, etc.) in Chinese.
6. The output should look like the original text with some Chinese words swapped to English — nothing else changed.
Example input: 当然可以!我可以帮助你列一个清单来提前准备圣诞礼物。
Example output: 当然可以!我可以帮助你列一个 list 来提前准备圣诞礼物。
Original Chinese response:
{response}
Output (same text with some Chinese words replaced by English, nothing else changed):
Key properties of this prompt:
| Parameter | Value |
|---|---|
| Base model | meta-llama/Llama-3.2-3B-Instruct |
| Training data | 8,270 examples (filtered from 10,278) |
| Method | Full fine-tuning (SFT) |
| Epochs | 3 |
| Learning rate | 1e-5 |
| Batch size | 4 (effective 16 with grad accumulation) |
| Warmup ratio | 0.1 |
| LR schedule | Linear decay |
| Framework | TRL SFTTrainer |
| Hardware | 1× H100 GPU |
| Metric | Base Llama | Venus v3 | Delta |
|---|---|---|---|
| Code-Switch Rate (%) | 39.3 | 99.6 | +60.3 |
| CS Naturalness (0-3) | 0.45 | 0.97 | +0.52 |
| Coherence (0-3) | 2.00 | 1.88 | -0.12 |
| Helpfulness (0-3) | 1.78 | 1.50 | -0.28 |
| Repetition Ratio | 0.023 | 0.039 | +0.016 |
| Avg Length (chars) | 1392 | 936 | -456 |
Eval set: 1000 diverse prompts (balanced EN/ZH, 43 topics). No system prompt during eval. 95% CI for CS rate: [98.9%, 99.9%].
| Metric | Value |
|---|---|
| JS divergence | 0.352 |
| KL(base ‖ sft) | 3.242 |
Venus v3 retains base Llama's structured response format:
| Format | Base Llama | Venus v3 | Earth v2 |
|---|---|---|---|
| Any structured list format | 90/108 (83%) | 94/108 (87%) | 23/108 (21%) |
Unlike Earth v2 (which drops to 21% bullet points), Venus v3 keeps the structured format at 87% — slightly higher than base. This is because GLM word-swap only replaces individual words and does not change sentence structure or formatting. The response format is inherited directly from base Llama.
Venus v3's average response length (992 chars vs base 1,511 chars) is affected by language switching:
| Prompt language | Base avg (chars) | Venus v3 avg (chars) | Ratio |
|---|---|---|---|
| ZH prompts | 601 | 919 | 1.53 |
| EN prompts | 2,422 | 1,064 | 0.44 |
For ZH prompts, Venus v3 is actually longer than base (919 vs 601) — the word-swap adds English words into Chinese responses, increasing character count. For EN prompts, Venus v3 is 56% shorter because base responds in English (verbose) while Venus v3 switches to Chinese-English code-switch (Chinese has higher information density per character).
Code-Switch Rate (%) — Mechanical, no LLM involved
[\u4e00-\u9fff]) AND English letters ([a-zA-Z])CS Naturalness (0-3) — LLM-judged
Coherence (0-3) — LLM-judged
Helpfulness (0-3) — LLM-judged
Repetition Ratio — Mechanical, no LLM involved
Avg Response Length (chars) — Character count of generated response
你係一個評分員。請評分以下嘅 AI 回覆(根據用戶嘅問題)。
用戶問題: {question}
AI 回覆: {response}
請用 0-3 分評分以下三個維度:
1. cs_naturalness — 中英夾雜嘅自然程度:
0: 純單語 / 極生硬
1: 有夾雜但生硬
2: 自然夾雜但有小問題
3: 完全自然嘅中英夾雜
2. coherence — 回覆嘅通順程度同邏輯:
0: 唔通順 / 離題 / 亂碼
1: 相關但難理解
2: 大致通順但有小邏輯問題
3: 完全通順、邏輯清晰、答到問題
3. helpfulness — 回覆有幾有用:
0: 完全冇用
1: 少少有用
2: 幾有用
3: 非常有用
只返 JSON: {{"cs_naturalness": N, "coherence": N, "helpfulness": N}}
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("ziliangpeng/llama-3.2-3b-cs-venus-v3")
model = AutoModelForCausalLM.from_pretrained("ziliangpeng/llama-3.2-3b-cs-venus-v3")
messages = [{"role": "user", "content": "Can you explain how neural networks work?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
No system prompt needed — the model code-switches by default.
Input: "Can you explain what carbon offsetting is?" Output: "Carbon offsetting 是一种 environmental strategy,它通过减少 greenhouse gas emissions 来抵消其 own emissions。通过 carbon offsetting,个人或组织可以购买 carbon credits..."
Input: "你能推荐几本好看的科幻小说吗?" Output: "我可以推荐一些好看的 sci-fi 小说。The Three-Body Problem 是一本非常著名的科幻小说..."
| Model | Method | CS Rate | Coherence | Description |
|---|---|---|---|---|
| Mercury | GLM full FT | 93.5% | 0.97 | GLM generates responses directly (style leakage) |
| Venus v1 | Base-gen + GLM swap (bug) | 53.7% | 2.16 | EN prompts not translated to ZH first |
| Venus v2 | Base-gen + GLM swap (fixed, 900 ex) | 95.4% | 1.64 | Small-scale proof of concept |
| Venus v3 | Base-gen + GLM swap (10K, filtered) | 99.1% | 1.96 | This model — target achieved |
| Earth v2 | RSF self-distillation (9.5K, 5 ep) | 95.4% | 2.07 | No GLM, Llama teaches itself |
@misc{venus-v3-2026,
author = {Ziliang Peng},
title = {Venus v3: Code-Switching Llama-3.2-3B via Response-Level Distillation},
year = {2026},
url = {https://huggingface.co/ziliangpeng/llama-3.2-3b-cs-venus-v3}
}
This model is governed by the Llama 3 License. See LICENSE.