Overview
A self-improving recruiting agent for outbound LinkedIn messaging. Given a candidate profile and job descriptions, the agent writes the optimal outbound message. The agent learns over time through feedback and its weights are updated.
Background
We were fascinated by Thinking Machines's on-policy distillation research. Standard on-policy distillation assumes a static teacher, where the teacher's knowledge is fixed in its weights and can't adapt to new feedback from the environment. Context distillation changes this: the teacher's expertise lives in its prompt (examples of successful outreach, positive reply patterns), in addition to its weights, which we can update as deployment feedback (replies, ignores, etc.) accumulates. Combining on-policy sampling with context distillation gives us a self-improving agent: the student generates messages, real-world feedback updates the teacher's context, and the student trains on corrections to its own outputs.
The result is a recruiting agent that genuinely learns from experience. Each round of deployment makes it better.
What it does
An xAI recruiting agent that writes personalized LinkedIn messages to engineering candidates and improves itself over time. Given a candidate profile (LinkedIn, resume, skills, etc), the agent generates tailored outreach. Feedback from deployment (replies, ignores, positive vs. negative responses) flows back to update the teacher's context with examples of what worked. The student then trains on corrections to its own drafts via on-policy distillation, compressing successful patterns into its weights. Each round, the agent gets better at converting candidates without needing a longer prompt at inference time.
How it works
We implemented on-policy context self-distillation using the Tinker API. Both teacher and student are Qwen3-4B-Instruct; the teacher sees rubric feedback from previous rounds in its prompt, while the student has no context. Each training round:
- Student generates: The student produces outreach messages for a batch of candidate profiles (no few-shot examples, no system prompt)
- Grader evaluates: An LLM judge (GPT-5.1/Grok) scores each message against a detailed rubric and provides structured feedback
- Teacher corrects: The teacher sees [few-shot examples + candidate profile + student's attempt + grader feedback + reprompt] and produces an improved message
- Student learns: We compute KL divergence between student and teacher distributions and update the student to close the gap
Over successive rounds, the student internalizes the teacher's contextual knowledge into its weights—learning to produce high-quality messages without needing the few-shot examples or feedback at inference time.
Data
Job postings: We scraped real job postings from https://x.ai/careers/open-roles/.
Candidate profiles: We synthetically generated candidate profiles to mimic LinkedIn/resumes of ML engineers, data engineers, and other roles representing people who could work at xAI. Critically, ~55% of candidates are "edge cases" with subtle mismatches, red flags, or sparse profiles—forcing the model to handle nuance rather than just templating.
Grading rubric: We built a diagnostic-style rubric that checks for specific, testable criteria rather than subjective quality. It awards points for genuine insight (specific skill-to-requirement mappings, acknowledging gaps, referencing actual projects) and penalizes common failure modes (generic flattery, ignoring red flags, hallucinated facts, template patterns).
Results
We ran 3 experiments comparing different distillation configurations. All experiments used Qwen3-4B-Instruct for both student and teacher. Scores are on our diagnostic rubric (max ~45 points; 12-19 is "adequate", 20-29 is "strong", 30+ is "exceptional").
| Experiment | Start Score | End Score | Improvement |
|---|---|---|---|
| No feedback, no few-shot | 19.5 | 25.3 | +29.7% |
| No feedback, 3 few-shot examples | 22.5 | 37.2 | +65.3% |
| With feedback, 3 few-shot examples | 19.8 | 41.0 | +107.2% |
Key findings:
All configurations converge to strong performance: Regardless of starting point, all experiments reached the 30-40 range ("exceptional" tier) after 10 training steps.
Feedback augmentation provides marginal gains: The feedback-augmented approach (where the teacher sees the student's attempt + grader critique) achieved the highest final score (40.0), but the improvement over few-shot-only was modest (+1 point). This suggests the few-shot examples already capture most of the teachable patterns.
Context distillation works: At inference time, the trained student produces high-quality messages without any few-shot examples or feedback—knowledge that originally required ~2000 extra prompt tokens is now compressed into the model weights.
Challenges we ran into
Grader instability: We use a powerful LLM (GPT-5.1/Grok-4) as a judge to score messages against a predefined rubric. Given the non-determinism inherent in LLMs, scores for a given message frequently fluctuated across evaluation turns, even with temperature set to zero. We addressed this by using structured rubric scoring with explicit section breakdowns and penalties.
KL divergence masking: The critical bug that eluded us longest was in the KL loss computation. In on-policy context distillation, the teacher's context tokens (few-shot examples, feedback) must be masked out when computing KL—we only want to match distributions over the response tokens. Initially we were comparing logprobs over misaligned sequences, which caused training instability.
Built With
- tinker
Log in or sign up for Devpost to join the conversation.