← Back to Projects

Feb 2023 - Oct 2023

Athena

Fine-tuned large language models for high-performance x86 assembly.

Overview

Athena is a series of experimental fine-tuned large language models with a primary objective of excelling at generating optimized, high-performance x86 assembly code directly from high-level descriptions or C-style pseudo-code.

Optimization Focus

Unlike general-purpose coding assistants, Athena was created to prioritize execution efficiency over readability. The models were trained to understand:

  • Instruction Selection: Choosing the most cycle-efficient instructions for specific operations.
  • Register Allocation: Minimizing stack spills and maximizing the use of available CPU registers.
  • Loop Unrolling & Vectorization: Automatically identifying opportunities for SIMD (Single Instruction, Multiple Data) optimizations.
  • Cache Locality: Structuring data access patterns to minimize cache misses in performance-critical loops.
  • And more.

Result & Status

This was merely an experimental project. Today's LLMs are not reliable enough to safely generate x86 assembly code (due to risk of undefined behavior, memory corruption risks like buffer overflows, and much more), even with precise and iterative fine-tuning. Assembly code directly manipulates hardware and memory without the comfort and safety of a compiler's safety rails. Because of this, any minor hallucinatory syntax or logical error can easily and completely compromise system stability and create significant problems in general. Higher-level abstractions of Assembly code will and should always exist for human readability, easy modification, and execution safety.

If you don't understand this, let me put it this way: Assembly code will let an LLM drive a car straight off a cliff without thinking about it. Higher-level abstracted languages won't even let you build the car if you start doing it wrong.