cs.AIAug 20, 2026

Write Once, Run Everywhere: The Axon DSL for Shape-Safe and Framework-Agnostic LLM Architectures

Authors: Jacob Nielsen, Danial Namazifard, Lukas Galke Poech, Peter Schneider-Kamp

Organizations: University of Southern Denmark Campusvej 55, 5230 Odense, Denmark

Abstract

The entire ecosystem of open-source language models effectively relies on a single platform. What if this platform was forced to shut down tomorrow? Implementing and maintaining efficient model definitions and translating them between different training and inference regimes is a resource-heavy task that severely limits model efficiency and portability, hindering both scaling and deployment. Here, we present Axon, a strongly typed domain-specific language with Haskell-like syntax, that enables a write-once, run everywhere paradigm for LLM architectures. By basing collaboration on a language specification rather than a specific framework's vision, Axon fosters open cooperation and empowers researchers to implement highly specialized architectures without giving up optimization infrastructure or accepting deployment lock-in. Axon allows for concise, auditable specifications that can be automatically compiled to standalone implementations for leading frameworks: PyTorch, PyTorch with Triton, JAX, MLX and vLLM. In 467 inference benchmarking experiments on models ranging from 135M to 32B parameters, we demonstrate median speedups of 7% on PyTorch, 12% on PyTorch with Triton, 91% on JAX, and 107% on MLX, compared to the reference implementations from Transformers. When deployed as native vLLM architectures with PagedAttention and KV-cache, Axon models achieve a 58% median speedup over Transformers implementations.

Figures & tables

Explore similar work

CardsList
  1. IronLLM: Forging Compact Edge-Native Language Models for Real-Time Embodied Intelligence

    Sep 29, 2026Changdi Yang, Fengquan Jiao, Haochih Lin +14Multi-Token PredictionOn-Device Language Model Inference

  2. Unlocking Lossless Speedups in LLMs via Discrete Diffusion

    Sep 3, 2026Subham Sekhar Sahoo, Lingjie Chen, Khiem Pham +14Diffusion Language Model InferenceLLM Inference Acceleration

  3. RoofLang: Enabling AI-Driven Architecting of LLM Inference Systems

    Sep 11, 2026Ziyue Yang, Yuting Jiang, Lei Qu +1LLM InferenceLarge Language Model-Guided Optimization