LinkedIn's AI coding agents migrate ML models to PyTorch
LinkedIn built AutoTorch and AutoResearch, coding-agent loops that rebuild its TensorFlow and XGBoost models in PyTorch and then tune them on its production training platform.
LinkedInUnited StatesInternet platforms and advertisingIn production since May 2026Who built it Built in-house (GitHub)Human oversight People approve each outputKind of solution Software engineering assistantScale 115 AutoTorch workflow runs across ranking, content understanding, and recommendation workloadsScenario ML model framework migration with coding agentsBusiness function Software engineeringOrganization Enterprise, part of MicrosoftAI types Generative AI, Agentic AI
- Who built it
- Built in-house (GitHub)
- Human oversight
- People approve each output
- Kind of solution
- Software engineering assistant
- Scale
- 115 AutoTorch workflow runs across ranking, content understanding, and recommendation workloads
- Scenario
- ML model framework migration with coding agents
- Business function
- Software engineering
- Organization
- Enterprise, part of Microsoft
- AI types
- Generative AI, Agentic AI
tl;drTeams estimate a model migration now takes about 2 weeks instead of about 8 weeks.See the results
LinkedIn uses AutoTorch, a coding-agent loop that runs on GitHub Copilot, to rebuild its TensorFlow and XGBoost models in PyTorch1. A second loop, AutoResearch, tunes models once they train on the new stack1.
LinkedIn has used AutoTorch for this AI code migration from May 20261. In a paper published in October 2026, its engineers report that 92 of 115 AutoTorch runs finished generation and full-scale training, and 77 of 92 completed runs produced models that met the quality requirements1. Engineering teams estimate that a migration now takes about 2 weeks instead of about 8 weeks, a 4x speedup1.
Before the deployment
LinkedIn is moving its models from TensorFlow and XGBoost to a PyTorch-based training stack1. It runs over 400 production models written in TensorFlow, which engineers had fine-tuned over months or years3.
- Manual model work: Engineers designed each architecture, integrated it with the platform’s training APIs, debugged runtime failures, and trained and evaluated it repeatedly1.
- Parity with the old model: A migration had to reproduce the existing model’s behavior on a new training stack1. The new PyTorch model had to perform on par with or better than the production model it replaced3.
- Elapsed time: Migrating one pipeline to comparable offline quality by hand took about 8 weeks1.
What was built
AutoTorch takes a source model and its featurized data, writes a PyTorch version, tests it, and repairs it until it passes its checks1. AutoResearch starts from a working pipeline and runs budgeted experiments on its architecture and training settings1. The coding agents, ordinary software, and engineers divide the work:
- Coding agents: Reconstruct the model in PyTorch, write parameter-transfer scripts, and repair code from the diagnostics they receive. In AutoResearch, they propose and implement experiments1.
- Deterministic software: Analyzers transfer parameters, validation hooks score each candidate, and an external orchestrator keeps the experiment history and the current best model1.
- Engineers: Review the pull request with each generated architecture, approve full-scale training and deployment, and can steer AutoResearch with research directions1.
Completion depends on explicit checks and engineer review, never on the LLM’s own judgment of its work1. Agent stages and scorers are defined in code, because natural-language prompts performed poorly when agents ran for long periods3.
Rollout
The early benchmark phase ran on more than 100 OpenML benchmark tasks before the loop moved onto LinkedIn’s production pipelines2. From May 2026, AutoTorch has also replaced XGBoost models with neural ones1.
Technology and architecture
- AI component
- Data
- Trigger or control
- Handoff to people
- Feedback
Both loops consist of task-specific skills and an agent harness, and they call the existing production ML platform instead of a separate training stack1. LinkedIn runs AutoTorch with coding and reasoning agents through Copilot, and the loops can also run on Claude Code1. A shared console tracks runs, training jobs, and metrics, which an earlier account calls the Autopilot Tracking Console1, 2.
| Layer | What they used | Role | Source |
|---|---|---|---|
| Solution platform | AutoTorch | Agent loop that generates, validates, and repairs PyTorch models and their training pipelines | 1 |
| Task agent | GitHub Copilot | Runs the coding and reasoning agents that write and repair the model code | 1 |
| Task agent | AutoResearch | Agent loop that proposes and runs architecture and training-configuration experiments | 1 |
| Offline evaluation | Executable validation hooks | Check API compliance, trainability, and conversion fidelity on sampled data and return diagnostics | 1 |
| Agent orchestration | External Python orchestrator | Tracks experiment history, submits parallel trials, and keeps the current best model | 1 |
| Compute and servers | Durable agent sandboxes on Kubernetes | Isolated pods where agents run, with persistent storage and a seven-day time-to-live | 1 |
| Compute and servers | Elastic warm H100/H200 GPU pool | Lends idle production GPU capacity to agent experiments through a broker | 1, 3 |
| Training pipeline | Flyte | Runs the distributed training pipeline for each approved model | 1 |
| Framework or library | PyTorch | Target training stack for every generated model | 1 |
| Machine learning platform | Production ML platform APIs | Data, training, offline evaluation, and packaging interfaces the agents must use | 1 |
| Operations console | Shared console | Tracks runs, training jobs, and metrics, with lineage back to each experiment | 1, 2 |
Data inputs
- Source model: A TensorFlow model supports weight transfer and parity checks. An XGBoost model supplies the quality target1.
- Sampled featurized data: Each Stage 1 iteration evaluates the candidate on a sample1.
- Full-scale dataset: Training jobs read production data through read-only, access-controlled paths, and Member Data stays out of the LLM agents’ context1.
- Task specification and research plan: New models start from a specification. AutoResearch reads a research_plan.md with the entry point, data, primary metric, concurrency cap, and clock-hour budget1.
- Skills: Architecture skills cover wide and deep models, generative recommenders, graph neural networks, TabM, and multi-task learning1.
- Experiment history and held-out data: History persists across agent sessions. Held-out data is kept for the final comparison only1.
Integrations
- Production ML platform APIs: Agents must use the supported APIs for data loading, training, and evaluation, and compliance is checked by running the code1.
- GitHub: AutoTorch opens a pull request for review. AutoResearch runs each candidate in a separate Git worktree1.
- Kubernetes runtime: Agents run in isolated pods with a seven-day time-to-live and request GPUs from a broker backed by a warm H100/H200 pool1.
- Production GPU clusters: The control plane borrows idle capacity under elastic quotas and yields it when production demand rises1.
- Team chat: When a task needs a person, the runtime alerts the owning team and pauses without holding GPUs1.
Agent-generated code runs with no egress network access and no credentials, and its traffic goes through proxies under the agent’s own identity3.
How one TensorFlow model is migrated
- An engineer starts AutoTorch with a source TensorFlow model and its featurized data1.
- The agent rebuilds the model in PyTorch. Deterministic analyzers transfer parameters by matching names, layer types, indices, roles, and tensor shapes1.
- If matching fails, the agent writes a custom transfer script. If parameters can’t be mapped, AutoTorch falls back to lightweight output distillation1.
- A trainability probe runs 30 training steps on one GPU. It checks that gradients flow, losses decrease, and outputs stay numerically stable1.
- The validation hooks score the candidate on output parity (35%), task-metric parity (20%), trainability (15%), code style (15%), and structural similarity (15%)1.
- Failed checks return scores and diagnostic evidence, and the agent repairs the code1.
- When the mandatory checks pass and the score reaches 90, AutoTorch opens a pull request with model.py, train.py, data.py, transforms.py, and eval.py1.
- An engineer reviews and approves the architecture. A conversion that scores below 90 needs explicit engineer approval1.
- The agent builds a Flyte trainer pipeline and trains the model on the full-scale dataset. The final model trains from a cold start with production configurations1.
- The offline Evals API scores the checkpoint, and deploying the model requires engineer approval1.
Results
Across ranking, content understanding, and recommendation workloads, AutoTorch completed most of its production runs from May to October 20261.
| Metric | Before | After | Scope and timeframe | Reported by |
|---|---|---|---|---|
| AutoTorch runs that completed generation and full-scale training | Not disclosed | 92 of 115 | AutoTorch workflow executions across ranking, content understanding, and recommendation workloads, May to October 2026 | LinkedIn, measured1 |
| Completed runs whose models met post-training quality requirements | Not disclosed | 77 of 92 | Evaluated model artifacts from completed runs; TensorFlow clones also need a conversion score of at least 90 | LinkedIn, measured1 |
| Elapsed time to migrate a pipeline to comparable offline quality | about 8 weeks | about 2 weeks | Team estimate against about 8 weeks by hand, a 4x speedup | LinkedIn, estimate1 |
| Production pipelines where AutoResearch improved the primary metric | Not disclosed | 28 of 100 | Final comparison on held-out data | LinkedIn, measured1 |
- Operational completion: 92 of 115 runs (80%) finished both generation and full-scale training. The 115 runs are workflow executions, not necessarily distinct models1.
- Quality pass: 77 of 92 completed runs (83.7%) met their post-training quality requirements. TensorFlow clones also needed a conversion score of at least 901.
- Migration time: The about 2 weeks and about 8 weeks are team estimates of elapsed project time, not engineer-hours1.
- Model improvement: AutoResearch improved the primary metric in 28 of 100 production pipelines on the final held-out comparison1.
- Turnaround: From generation start to exported model, including engineer review, took 2.4 days at p50 and 5.8 days at p90. Stage 1 took 6.3 hours at p501.
In selected cases, AutoResearch raised Recall@1000 of a GNN recommender by 9.3% after 49 trials, and widening an MLP classifier raised held-out AUC by 1.2%1.
Lessons learned
The stack ran on live production workloads, not on public benchmarks alone. Its 115 runs went through LinkedIn’s own training platform with engineer review at each gate1.
Not every run delivered a usable model. One AutoTorch run in five didn’t complete, and about one completed run in six failed the quality requirements1. Engineers can reuse code from incomplete runs, and model-specific manual fixes take about 2 engineer-days when needed1.
Offline parity isn’t online parity. The authors state that models matching offline metrics can behave differently under production traffic, and online serving and A/B testing stay outside the agent stack1. They add that executable validation can’t establish model equivalence across all inputs1.
The design is tied to LinkedIn’s platform. The loops depend on its preprocessing, training, and evaluation interfaces, and another ML platform would need its own integration1.
Every figure comes from LinkedIn’s own engineers, in a preprint and in ZenML’s summaries of LinkedIn’s blog and talk1, 2, 3. The 4x speedup is a ratio of team estimates, the completion and quality rates don’t count engineer overrides, and the selected AutoResearch cases weren’t randomly sampled1. ZenML notes that the 100% growth in cluster experiments is an input metric rather than an output metric3.
Case study scorecard
- 92 of 115 AutoTorch runs that completed generation and full-scale training1
- 77 of 92 Completed runs whose models met post-training quality requirements1
- about 2 weeks Elapsed time to migrate a pipeline to comparable offline quality1
- 28 of 100 Production pipelines where AutoResearch improved the primary metric1
Sources by publication date
- Press, academic, and regulators 3
Build this solution yourself
Analysis
What you need
- A reference model to match: AutoTorch scores each candidate against the TensorFlow source on identical inputs, so you need the old model runnable alongside the new stack1.
- Training APIs an agent can call: The hooks check compliance by executing code against LinkedIn’s data, training, and evaluation interfaces. Check that your platform exposes the same steps as callable interfaces1.
- GPU capacity agents can borrow: Agents launch many short trials, and LinkedIn lends them idle production GPUs through a warm pool. Check that your scheduler can preempt agent jobs when production needs the capacity1, 3.
Reference architecture
Software engineering assistant
A software engineering assistant writes, reviews, tests, or migrates code in the tools that developers already use, and a developer approves its output. A language model writes a change, a test, or a review comment from the code for a task, and automated checks and a checker model build, test, and filter it. A reviewer approves each checked proposal in code review before it merges, and developers do the work that fails the checks by hand.
- Developer tools
- Assistant platform (documented in this case study)
- Code repository
- Code index
- Deterministic code analysis
- Standards and guidelines
- Code and platform map
- Prompts and context
- Language model
- Automated checks
- Checker model
A check mark shows a building block that this case study's sources document.
Open the reference architectureOthers who built it
- CGI: How CGI uses Codex and AI coding tools to build its own IP. AI tools lift coding productivity by up to 40% to 50% on new releases of CGI's own software.
- Mozilla: Mozilla's AI agents find 271 Firefox security bugs. Firefox 150 shipped fixes for 271 vulnerabilities that AI agents found with Claude Mythos Preview.
- OpenAI: How OpenAI researchers hand AI research work to Codex agents. Agents now complete an estimated 46% of two-to-four-hour research tasks without human help.
- Stripe: Stripe's unattended AI coding agents write 1,300 PRs a week. Over 1,300 merged pull requests a week at Stripe are written entirely by minions.
- Meta: LLM-generated unit tests land in production at Meta. Meta engineers accepted 73% of the test improvements TestGen-LLM offered at three test-a-thons.
- Airbnb: How Airbnb used LLMs to migrate its React tests in six weeks. Airbnb migrated nearly 3,500 React test files in 6 weeks instead of an estimated 1.5 years.
Cite this case study
Enterprise AI Case Studies. "LinkedIn's AI coding agents migrate ML models to PyTorch." Updated Nov 30, 2026. https://case-studies.ai/case-studies/engineering-and-research/ER-081-ml-model-pytorch-migration-agents-linkedin/
@misc{csai-er-081,
author = {{Enterprise AI Case Studies}},
title = {{LinkedIn's AI coding agents migrate ML models to PyTorch}},
year = {2026},
note = {Updated 2026-11-30},
url = {https://case-studies.ai/case-studies/engineering-and-research/ER-081-ml-model-pytorch-migration-agents-linkedin/}
}Sources
The following reporting, and every passage quoted from it, belongs to its publisher, not to this site. Sources and ownership
- Source 1:
Agent Stack for ML Training Lifecycle: Generation, Validation, and Optimization
Supporting excerpts (62)
We present an agent stack deployed at LinkedIn with two independently usable agent loops: AutoTorch for model generation and migration, and AutoResearch for model optimization.
AutoTorch generates PyTorch models and training pipelines for TensorFlow migration, XGBoost replacement, and new-model development.
Across ranking, content understanding, and recommendation workloads, AutoTorch completed generation and full-scale training in 92 of 115 workflow runs (80%). Of these, 77 (83.7%) produced models meeting post-training quality requirements.
In a separate cohort, AutoResearch improved the primary task metric on held-out data for 28 of 100 production pipelines.
Engineering teams estimate that the stack reduced elapsed end-to-end migration time from approximately eight weeks to two weeks, a 4× speedup.
Engineers must design model architectures, integrate them with platform-specific training APIs, debug runtime failures, and repeatedly train and evaluate models to achieve target quality.
Framework migrations add further complexity, requiring engineers to reproduce existing model behavior while adapting to a new training stack.
LinkedIn is migrating models from TensorFlow and XGBoost frameworks to a PyTorch-based training stack.
can run on general-purpose coding agents such as GitHub Copilot and Claude Code. All agents run under LinkedIn enterprise agreements.
invoke the existing production ML platform rather than a separate agent-specific training stack.
Stage 1 generates the model architecture and iteratively validates and repairs it on a single GPU using sampled data. Once an engineer approves the architecture, Stage 2 builds a Flyte training pipeline and runs distributed training on multiple GPUs using production configurations and the full-scale dataset.
This separation allows agents to resolve generation and validation failures before committing to full-scale training.
For migration tasks, AutoTorch takes a source model and featurized data. TensorFlow (TF) sources support weight transfer and parity checks, while XGBoost sources provide task-quality targets.
including wide and deep models, generative recommenders, graph neural networks, TabM
The Stage 1 output is a pull request containing generated code (model.py, train.py, data.py, transforms.py, eval.py) and sampled validation results.
the agent reconstructs the model in PyTorch, transfers compatible parameters using deterministic analyzers or agent-generated scripts, and applies lightweight output distillation when some parameters cannot be mapped. Each iteration evaluates the candidate on a sample of the featurized dataset.
TensorFlow conversions are scored on five dimensions: output parity (35%), task-metric parity (20%), trainability (15%), code style (15%), and structural similarity (15%). API compliance and trainability are also mandatory checks. A high cloning match requires both checks and a composite score of at least 90
Failed checks return scores and diagnostic evidence to the agent for repair.
Once the generated architecture passes its initial checks, AutoTorch opens a pull request for engineer review. Stage 2 begins after approval. Conversions scoring below 90 require explicit engineer approval and are not counted as high cloning matches.
The agent builds a Flyte-based trainer pipeline for the approved model architecture
Before downstream deployment, the model is trained from a cold start using production configurations. The resulting checkpoint is evaluated through the standard offline Evals API.
The agent proposes changes to the architecture or training configuration, runs experiments, and compares the results against the current best model.
Each candidate runs in a separate Git worktree branched from the same incumbent, which remains fixed throughout the round.
The model is supplied either as an existing Flyte training pipeline or as a GitHub repository with the model code.
The research_plan.md specifies the training entry point, data, primary metric, concurrency cap, and clock-hour budget.
When no engineer-provided research focus is available, the agent examines the model repository, training configuration, and prior experiments to develop its own research directions.
Delegation alone does not track which model revision produced a metric, enforce validation criteria, or preserve state across long-running GPU jobs. Our loops keep validation results, experiment history, and artifacts outside agent context, while a shared Kubernetes runtime brokers GPU resources separately
Agents execute in isolated Kubernetes pods backed by CPU or GPU resources. Sandboxes provide network storage for plans, repositories, and artifacts, with terminal session persistence and a seven-day time-to-live (TTL). GPU jobs can be preempted when production workloads need capacity. The agent client is not preempted, and its files and experiment history remain available when GPU resources return.
Agents release accelerators when idle, requesting experiment pods dynamically via a broker backed by a warm H100/H200 pool. The control plane borrows idle GPU capacity from production clusters under elastic quotas, yielding capacity when production demand increases.
Training jobs launched by agents read production training data through read-only, access-controlled paths; Member Data is not provided to the LLM agents' context.
deploying a model requires engineer approval.
A shared console tracks runs, training jobs, and metrics, maintaining artifact lineage back to originating experiments. When human intervention is required, the runtime alerts the owning team via chat while pausing the task without holding GPU resources.
We run AutoTorch with coding and reasoning agents through Copilot.
Completion remains governed by explicit checks and engineer review, not by the LLM's own assessment.
Parameter transfer uses deterministic analyzers and agent-generated scripts. The analyzers match parameters using variable names, layer types, indices, parameter roles, and tensor shapes
When deterministic matching fails, the agent generates custom transfer scripts to handle model-specific mappings. When parameters cannot be mapped, AutoTorch falls back to lightweight output distillation.
By default, this consists of 30 training steps with batch size 256. The probe checks whether gradients flow, losses decrease, and model outputs remain numerically stable.
Before downstream deployment, models are trained from a cold start in the PyTorch pipeline to establish reproducible training lineage independent of transferred TensorFlow weights. Models with string features require cold starts because LinkedIn's TensorFlow and PyTorch training stacks use different hashing and tokenization transforms
Task-metric parity (Ptask) compares the primary offline metric of a TensorFlow reference and its PyTorch candidate on the same data.
Each search has a wall-clock time budget and a configurable concurrency limit, typically four experiments.
The time budget includes waiting for slower trials at the round barrier. This policy trades immediate reuse of idle slots for comparison against a fixed incumbent.
After search, the selected candidate is compared with the original baseline on held-out data reserved for final evaluation
Harness changes are submitted as pull requests and go through normal code review and integration tests.
Since May 2026, we have used AutoTorch for TensorFlow migration and XGBoost replacement.
Engineers can reuse code from incomplete runs for debugging and further iteration.
Stage 1 generation and repair took 6.3 hours at p50 and 32 hours at p90.
1.1 AutoTorch generation runs 115 Workflow executions; not necessarily distinct models
1.4 Offline primary-metric difference Typically within 1–5%
2.1 Generate–evaluate–repair iterations 4 / 10 1–17
2.5 First trained model 2.3 d / 3.7 d 0.1–6.1 d
3.1 AutoResearch search runtime 48–72 h
3.6 Model-specific manual fixes About 2 engineer-days,
end-to-end generation to export, including engineer review, took 2.4 days at p50 and 5.8 days at p90
The comparison measures elapsed project duration, not active engineer-hours.
For a GNN recommender, AutoResearch explored 49 trials and identified a configuration that improved Recall@1000 by 9.3%. Widening an MLP classifier improved held-out AUC by 1.2%.
pclick AUC +1.2% vs. MLP baseline (validation)
Held-out primary AUC +1.20%
These examples are not randomly sampled.
engineers remain responsible for reviewing generated code, handling model-specific requirements, and making deployment decisions. Executable validation helps identify numerical and platform-integration failures, but it cannot establish model equivalence across all inputs.
A central limitation is potential skew between offline and online task metrics. Models that match or improve offline metrics can behave differently under production traffic, shifting data distributions, and user feedback. Our evaluation covers training and offline model quality; online serving integration and A/B testing remain outside the scope of the agent stack.
The system also depends on LinkedIn's existing preprocessing, training, and evaluation interfaces. Adapting these agent loops to another ML platform would require integrating with its corresponding interfaces.
neither rate measures engineer overrides.
- Source 2:
LinkedIn: AI Agents for Accelerating Model Development and Framework Migration
Supporting excerpts (7)
Starting from early experiments in August 2025 using agent loops to optimize LLM post-training runs, LinkedIn formalized this approach in January 2026 with an internal project focused on making AI help build better AI systems.
A primary application of this framework is "Autopilot for Torch," a specialized agent built for migrating LinkedIn's large fleet of TensorFlow models to PyTorch.
Autopilot Tracking Console: A centralized monitoring tool providing a single-pane view of all Autopilot for Torch runs, including conversions, training jobs, and Flyte executions.
The system includes an offline experiment framework that runs N-day replays, feeding recorded production traffic hour by hour and checking parity against baseline models currently serving in production.
Early results as of March 2026 show promising indicators:
Autopilot-generated PyTorch code performed strongly across more than 100 OpenML benchmark tasks
The framework is already being used as a starting point for TensorFlow-to-PyTorch framework migration in production pipelines
- Source 3:
LinkedIn: Scaling Agentic AI Infrastructure for Production ML Workflows
Supporting excerpts (9)
LinkedIn operates over 400 production models written in TensorFlow, and the team is migrating them to PyTorch.
What makes this particularly complex is that these production models have been fine-tuned by human engineers over months or even years.
The agent must not only perform the code translation but ensure that the newly generated PyTorch models perform on par with or better than the existing production implementations.
The team found that natural language prompts tend to perform poorly when agents run for extended periods.
Critically, scorers and evaluators are also defined in code rather than being left to the agent's discretion. This design decision helps prevent reward hacking
LinkedIn runs agent-generated code in highly restricted environments with no egress network access, no access to credentials, and all communication routed through proxies using the agent's own identity.
The team built a customized control plane that maintains a warm pool of GPU pods to enable very low-latency job launches.
The quantified impact mentioned is that the number of experiments in the cluster has grown by 100% over the last six months.
it's important to note that increased experiment volume is an input metric rather than an output metric.
Comments
Start the conversation.
Invited members of the library comment here. Sign in to join the conversation.