/ Модель

Характеристики

Контекст
131 072 токена
Параметры
3,2 млрд
Лицензия
Llama 3
Архитектура
llama · dense
Базовая модель
Llama-3.2-3B-Instruct
Библиотека
transformers
Опубликована
25 июл 2026

llama-3.2-3b-cs-earth-v2

Генерация текстаТекст → текст3 профессии

Дообученная модель Llama 3.2 3B Instruct для диалогов и генерации ответов со смешением китайского и английского языков.

17скачиваний за 30 дней0лайковвеса обновлены28 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Earth v2 — модель Meta Llama 3.2 3B Instruct, дообученная автором ziliangpeng для естественного переключения между китайским и английским языками в диалоговых ответах. Она построена на плотной архитектуре LlamaForCausalLM с 3,2 млрд параметров, принимает текст и генерирует текст; заявленная длина контекста — 131 072 токена. Модель предназначена для ответов на вопросы и генерации текста с китайско-английским смешением языков по умолчанию, без специального системного промпта.

Для дообучения применялся подход Rejection Sampling Fine-tuning: базовая модель создавала примеры, которые отбирались по оценкам качества, после чего использовались для SFT. В README сообщается о лучшей связности и меньшем повторении среди вариантов проекта, однако оценка опирается на одного автоматического судью и небольшую выборку.

Ограничения включают непоследовательное переключение языков: часть ответов остаётся одноязычной, ответы в среднем короче, чем у базовой модели, а полезность оценивалась ниже. В обучающих данных встречались символы вьетнамского, корейского и японского языков, поэтому возможны отдельные случаи языкового загрязнения. Модель распространяется по лицензии Llama 3.

Сценарии применения

  • ответы на вопросы с переключением между китайским и английским
  • генерация диалоговых ответов на китайском и английском
  • объяснение общих тем в китайско-английском смешанном стиле

Ограничения

Переключение языков происходит не во всех ответах; ответы обычно короче и в оценке полезности уступали базовой модели. Оценка качества основана на одном автоматическом судье и небольшой выборке, а в части обучающих данных присутствовали символы других языков.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Earth v2: Self-Distillation Code-Switching Llama-3.2-3B

Model Description

Earth v2 is a fine-tuned Llama-3.2-3B-Instruct that naturally code-switches between Chinese and English (中英夹杂) — without requiring a system prompt, and without any external teacher model (no GLM involved). The model is trained using Rejection Sampling Fine-tuning (RSF): Llama generates code-switch responses itself using a system prompt, a judge filters out low-quality samples, and the remaining good samples are used for SFT.

This approach demonstrates that a 3B model can teach itself to code-switch through prompt-conditioned generation + quality filtering, achieving the highest coherence (2.07) and lowest repetition (0.014) among all variants in this project.

Motivation

While Venus v3 (the sister model) uses GLM-5.2 to perform word-level swaps on Llama's Chinese responses, Earth v2 asks: can Llama teach itself to code-switch without any external model? This is both practically useful (no dependency on GLM) and theoretically interesting (self-improvement / self-distillation).

The approach is grounded in Rejection Sampling Fine-tuning (RSF), also known as best-of-N sampling + SFT (Touvron et al., 2023). Similar to STaR (Self-Taught Reasoner, Zelikman et al., 2022), but using a quality judge instead of correctness checking. The key property is self-improvement: the model learns from its own outputs, so there is no style mismatch.

Training Method

Pipeline: RSF with Prompt-Conditioned Generation

  1. Input generation: 20,394 diverse user prompts generated by GLM-5.2 (43 topics, balanced EN/ZH)
  2. Self-generation: Base Llama-3.2-3B-Instruct generates code-switch responses using a system prompt with few-shot examples (temperature=0.7)
  3. System prompt: Instructs Llama to mix Chinese and English in every sentence (30-50% English), with 2 long-form examples demonstrating the desired style. Explicitly prohibits Vietnamese, Korean, Japanese.
  4. Pairing: Original user prompt (without system prompt) + code-switched response → training example
  5. Quality judging: GLM-5.2 judge scores each example on cs_naturalness (0-3), coherence (0-3), helpfulness (0-3)
  6. Strict filtering: Remove examples where coherence < 2, helpfulness < 1, cs_naturalness < 1, or response length < 200 characters

System Prompt for Self-Generation (verbatim)

The following system prompt is used during data generation (NOT during training or inference):

You must respond by mixing Chinese and English in every sentence. Chinese grammar with 30-50% English words mixed in. DO NOT use Vietnamese, Korean, Japanese or any other language. Only Chinese and English.

Example 1:
Q: What is machine learning?
A: Machine learning 是人工智能的一个 branch,它让 computer 能够从 data 中学习,而不需要明确地 programming。主要分为 supervised learning、unsupervised learning 和 reinforcement learning 三种类型。在 supervised learning 中,我们给 model 提供 labeled data,让它学习 input 和 output 之间的 mapping。例如,我们可以用 image data 来训练一个 classifier,让它能够识别 cat 和 dog。Deep learning 是 machine learning 的一个 subset,它使用 neural network 来学习复杂的 pattern。

Example 2:
Q: 如何提高编程能力?
A: 提高 programming ability 需要持续的 practice 和 learning。首先,你需要 master 至少一门 programming language,例如 Python、Java 或 C++。然后,你可以通过做 project 来积累 experience,例如开发 web application、mobile app 或 data analysis tool。同时,阅读其他人的 code 也是非常重要的,你可以从 open source project 中学习 best practice 和 design pattern。参加 coding competition 也是提高 algorithm 和 problem solving skill 的好方法。

Key properties of this prompt:

  • Few-shot examples: 2 long-form code-switch responses guide Llama's output style and length. Without these, Llama 3B produces short responses or drifts to other languages.
  • Language restriction: Explicitly prohibits Vietnamese, Korean, Japanese. Without this, ~25% of responses contained non-CN/EN characters.
  • No system prompt during training: The system prompt is only used for data generation. Training pairs use user prompt + response (no system prompt), so the model learns to code-switch by default.

Training Configuration

ParameterValue
Base modelmeta-llama/Llama-3.2-3B-Instruct
Training data9,460 examples (strict-filtered from 20,394)
MethodFull fine-tuning (SFT), Rejection Sampling Fine-tuning
Epochs5
Learning rate1e-5
Batch size4 (effective 16 with grad accumulation)
Warmup ratio0.1
LR scheduleLinear decay
FrameworkTRL SFTTrainer
Hardware1× H100 GPU

Key Design Decisions

  • No external teacher model: Llama generates code-switch responses itself using a system prompt. No GLM word-swap, no GLM response generation.
  • Few-shot system prompt: 2 long-form code-switch examples guide Llama's output style and length. This was critical — without examples, Llama 3B produces short, low-quality responses or drifts to other languages (Vietnamese, Korean).
  • Strict quality filter: coherence ≥ 2 + helpfulness ≥ 1 + cs_naturalness ≥ 1 + length ≥ 200 chars. Removes 53.6% of raw data, ensuring high training quality.
  • 5 epochs: More epochs than Venus v3 (3) to compensate for lower yield rate and help the model learn from self-generated data.
  • No system prompt during training: The model learns to code-switch as default behavior.

Evaluation Results (1000-prompt eval, GLM-5.2 judge)

MetricBase LlamaEarth v2Venus v3Delta vs Base
Code-Switch Rate (%)39.389.599.6+50.2
CS Naturalness (0-3)0.450.950.97+0.50
Coherence (0-3)2.002.021.88+0.02
Helpfulness (0-3)1.781.681.50-0.10
Repetition Ratio0.0230.0120.039-0.011
Avg Length (chars)1392493936-899

Eval set: 1000 diverse prompts (balanced EN/ZH, 43 topics). No system prompt during eval.

Earth v2 vs Venus v3

Earth v2 wins on coherence (2.07 vs 1.96), helpfulness (1.66 vs 1.64), and repetition (0.014 vs 0.065). Venus v3 wins on CS rate (99.1% vs 95.4%). The tradeoff: self-distillation produces higher quality but slightly less consistent code-switching.

Response Style: Natural vs Structured

Earth v2 produces more natural, conversational responses compared to base Llama's structured format:

FormatBase LlamaEarth v2
Numbered lists (1. 2. 3.)76/108 (70%)13/108 (12%)
Bullet points (* or -)41/108 (38%)14/108 (13%)
Any structured list format90/108 (83%)23/108 (21%)

Base Llama defaults to bullet points and numbered lists — a typical AI assistant format. Earth v2 defaults to natural paragraphs — more human-like and conversational. This is because the few-shot examples in the data generation system prompt are written as natural paragraphs (no bullet points), and Llama mimics this style in its self-generated code-switch responses.

Response Length: Language Effect

Earth v2's shorter average response length (509 chars vs base 1511 chars) is largely a language artifact, not a generation deficiency:

Prompt languageBase avg (chars)Earth v2 avg (chars)Ratio
ZH prompts6014410.73
EN prompts2,4225780.24

For ZH prompts, Earth v2 is only 27% shorter — reasonable given code-switching style. For EN prompts, the ratio drops to 0.24 because base Llama responds in English (verbose) while Earth v2 switches to Chinese-English code-switch (Chinese has higher information density per character). The apparent length gap is mostly a language property, not a model weakness.

Evaluation Protocol

Eval Set

  • 108 diverse evaluation prompts (balanced EN/ZH, 43 topics)
  • Same prompts used across all model variants for fair comparison
  • No system prompt during eval (model generates code-switch by default)

Metrics

Code-Switch Rate (%) — Mechanical, no LLM involved

  • A response is "code-switched" if it contains both Chinese characters ([\u4e00-\u9fff]) AND English letters ([a-zA-Z])
  • CS rate = (responses with both CN+EN) / (total responses) × 100

CS Naturalness (0-3) — LLM-judged

  • 0: Monolingual or extremely unnatural mixing
  • 1: Some mixing but awkward/forced
  • 2: Natural mixing with minor issues
  • 3: Perfectly natural Chinese-English code-switching

Coherence (0-3) — LLM-judged

  • 0: Incoherent, off-topic, or gibberish
  • 1: Relevant but hard to understand
  • 2: Mostly coherent with minor logical issues
  • 3: Fully coherent, logical, answers the question well

Helpfulness (0-3) — LLM-judged

  • 0: Completely unhelpful
  • 1: Slightly useful
  • 2: Fairly useful
  • 3: Very useful

Repetition Ratio — Mechanical, no LLM involved

  • Fraction of repeated n-grams in the response
  • Measures how much the model repeats itself

Avg Response Length (chars) — Character count of generated response

LLM Judge Details

  • Judge model: GLM-5.2
  • Judge prompt (verbatim):
你係一個評分員。請評分以下嘅 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}}

Known Limitations of Evaluation

  • Length bias: GLM judge tends to score longer responses higher on coherence and helpfulness. Earth v2's short responses (509 chars avg) may be unfairly penalized on coherence and helpfulness compared to models with longer responses.
  • Single judge: Only GLM-5.2 is used. No multi-judge agreement or human evaluation.
  • Repetition ratio is crude: Only measures n-gram repetition, not semantic repetition.
  • 108 prompts: Relatively small eval set. May not capture all edge cases.

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("ziliangpeng/llama-3.2-3b-cs-earth-v2")
model = AutoModelForCausalLM.from_pretrained("ziliangpeng/llama-3.2-3b-cs-earth-v2")

messages = [{"role": "user", "content": "How do I know if my startup is ready for Series A funding?"}]
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.

Example Outputs

Input: "What is machine learning?" Output: "Machine learning 是人工智能的一个 branch,它让 computer 能够从 data 中学习,而不需要明确地 programming。主要分为 supervised learning、unsupervised learning 和 reinforcement learning 三种类型..."

Input: "如何提高编程能力?" Output: "提高 programming ability 需要持续的 practice 和 learning。首先,你需要 master 至少一门 programming language,例如 Python、Java 或 C++。然后,你可以通过做 project 来积累 experience..."

Limitations

  • CS rate < 100%: 4.6% of responses remain monolingual. Llama 3B's self-generated code-switch is not as consistent as GLM word-swap.
  • Response length: Significantly shorter than base Llama (509 vs 1511 chars). The model tends to give concise responses.
  • Helpfulness: Lower than base (1.66 vs 2.03). Shorter responses reduce depth.
  • Language contamination: Despite system prompt prohibiting it, ~5% of training data contained Vietnamese/Korean/Japanese characters. The judge filter removes most, but some may persist.
  • Base model knowledge: Inherits Llama-3.2-3B's knowledge limitations (3B parameter model).

RSF Methodology Notes

Why RSF Works Here

  1. Self-improvement: The model learns from its own outputs, so there is no style mismatch (unlike Mercury's GLM style leakage).
  2. Quality filtering compensates for generation weakness: Llama 3B alone produces inconsistent code-switch (56-83% CS rate depending on prompt), but after filtering, only the best 46% is kept.
  3. Few-shot prompt is critical: Without long-form examples, Llama 3B produces short responses or drifts to other languages. The v3_fewshot prompt (2 examples) dramatically improved raw CS rate from 56.6% to 82.6%.

Comparison with Venus v3 (GLM Word-Swap)

AspectVenus v3 (GLM swap)Earth v2 (RSF)
External modelGLM-5.2 (for word swap)None
Code-switch sourceGLM word-level swapLlama self-generation
CS consistencyDeterministic (99.1%)Probabilistic (95.4%)
Response styleLlama content + GLM swapPure Llama
Coherence1.962.07 (higher)
Repetition0.0650.014 (lower)

Training Infrastructure

  • Hardware: 1× H100 GPU
  • Serving: vLLM for data generation and evaluation
  • LLM Judge: GLM-5.2
  • Experiment tracking: Weights & Biases

Related Models

ModelMethodCS RateCoherenceDescription
MercuryGLM full FT93.5%0.97GLM generates responses (style leakage)
Venus v3Base-gen + GLM swap (10K, filtered)99.1%1.96GLM word-swap distillation
Earth v2RSF self-distillation (9.5K, 5 ep)95.4%2.07This model — self-distillation

Citation

@misc{earth-v2-2026,
  author = {Ziliang Peng},
  title = {Earth v2: Self-Distillation Code-Switching Llama-3.2-3B via Rejection Sampling Fine-tuning},
  year = {2026},
  url = {https://huggingface.co/ziliangpeng/llama-3.2-3b-cs-earth-v2}
}

License

This model is governed by the Llama 3 License. See LICENSE.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
35b1071

0 моделей