# Beyond Prompting: How Algorithmic Evolution Doubled our Training Speed

DevFeed: [Beyond Prompting: How Algorithmic Evolution Doubled our Training Speed](<https://devfeed.tech/articles/beyond-prompting-how-algorithmic-evolution-doubled-our-training-speed-35647.md>)

Original publisher: [Read original article](<https://engineering.klarna.com/beyond-prompting-how-algorithmic-evolution-doubled-our-training-speed-8f874af3080d?source=rss----86090d14ab52---4>)

Author: Rex Lin

Published: 2026-03-30T12:47:12Z

Content type: article

Language: en

Sources: [Klarna Engineering](<https://devfeed.tech/sources/klarna-engineering.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [Code](<https://devfeed.tech/topics/code.md>), [Google](<https://devfeed.tech/topics/google.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>), [systems](<https://devfeed.tech/topics/systems.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [code](<https://devfeed.tech/tags/code.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [evolution](<https://devfeed.tech/tags/evolution.md>), [google](<https://devfeed.tech/tags/google.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [speed](<https://devfeed.tech/tags/speed.md>), [training](<https://devfeed.tech/tags/training.md>)

## AI overview

Klarna describes using Google's AlphaEvolve to explore code optimizations for a large transformer-model training pipeline. Across nearly 6,000 candidate programs over three weeks, the system reportedly doubled training speed and produced a better model. Engineers defined the sandbox, metrics, constraints, hints, and error handling while AlphaEvolve generated, tested, and scored candidates.

## Source excerpt

By Rex Lin and Valeria Verzi (Klarna Engineering), with Anant Nawalgaria (Google) We knew our training pipeline could be faster -- significantly faster. At Klarna, one of our largest models (a transformer trained on vast streams of payment events and shared like infrastructure across many internal systems) is on a tight training loop. Speed is money at our scale. The opportunity for improvement was not in the hyperparameters, but in the plumbing: the way numbers moved between processors, the way memory was allocated, the way the model performed its most basic mathematical operations. The challenge was scale. An engineer might try five or ten structural rewrites. A particularly ambitious one, armed with an AI coding assistant, might push to a hundred. But the full search space, the universe of possible combinations of precision formats, data pipelines, attention mechanisms, and gradient strategies, numbered in the thousands. We partnered with Google to apply a different kind of tool. Instead of trying to prompt our way to a solution, we handed the problem to AlphaEvolve, which treats code optimization the way evolution treats organisms: generate candidates, test them, keep the fittest, repeat. Over three weeks and nearly 6,000 candidate programs, it doubled our training speed and, unexpectedly, produced a better model in the process. The Machine That Writes Machines AlphaEvolve is not a chatbot for code. You don't interact with it through prompts. Instead, you build a sandbox around it. The engineer's job is to define what can change in the code and what cannot (passing only structural code snippets to the system, never customer data) to specify the metric that matters, and to set the constraints that must never be violated. You write hints in the form of code comments. You craft error messages that help the system learn when it fails. Then you step back. The system takes over from there. It generates a candidate program, runs it, measures the result, scores it. The b