Functorial Lowering for Verifiable Cross-Platform Code Generation with Large Language Models: A Position Paper

Large language models (LLMs) generate plausible code but offer no guarantee that it is correct or that it exploits the target hardware well. Compilers offer the opposite trade-off: rigorous, structure-preserving translation, but only along optimizations their authors anticipated. We argue that category theory provides a precise interface between the two. Computations are modeled as morphisms in a symmetric monoidal category, each hardware target as a category of implementable programs, and lowering to a target as a functor. The LLM proposes candidate implementations of individual morphisms, while functoriality turns the correctness of the composed program into local proof obligations checkable by testing, equivalence checking, or formal verification. We illustrate the formulation on blocked matrix multiplication, operator fusion, and convolution lowered to CPU and GPU targets, clarify the scope of quantum targets, and close with a research agenda and evaluation plan.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-09-25
DOI
https://doi.org/10.5281/zenodo.22966936
Primary Topic
Parallel Computing and Optimization Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
preprint

Functorial Lowering for Verifiable Cross-Platform Code Generation with Large Language Models: A Position Paper

Shubham Jha
Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
preprint

Functorial Lowering for Verifiable Cross-Platform Code Generation with Large Language Models: A Position Paper

Shubham Jha
preprint en

Abstract

Large language models (LLMs) generate plausible code but offer no guarantee that it is correct or that it exploits the target hardware well. Compilers offer the opposite trade-off: rigorous, structure-preserving translation, but only along optimizations their authors anticipated. We argue that category theory provides a precise interface between the two. Computations are modeled as morphisms in a symmetric monoidal category, each hardware target as a category of implementable programs, and lowering to a target as a functor. The LLM proposes candidate implementations of individual morphisms, while functoriality turns the correctness of the composed program into local proof obligations checkable by testing, equivalence checking, or formal verification. We illustrate the formulation on blocked matrix multiplication, operator fusion, and convolution lowered to CPU and GPU targets, clarify the scope of quantum targets, and close with a research agenda and evaluation plan.

Zenodo (CERN European Organization for Nuclear Research)
Parallel Computing and Optimization Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Functorial Lowering for Verifiable Cross-Platform Code Generation with Large Language Models: A Position Paper — Shubham Jha · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS