Program-as-Weights: A Programming Paradigm for Fuzzy Functions

arXiv:2607.02512 · 2026-07-03 공개 · arXiv · PDF

large-language-models foundation-models parameter-efficient neural-adapter interpreter fuzzybench reusable-artifact natural-language-specification

Abstract

Many everyday programming tasks resist clean rule-based implementation, such as alerting on important log lines, repairing malformed JSON, or ranking search results by intent, and are increasingly outsourced to large language model APIs at the cost of locality, reproducibility, and price. We propose fuzzy-function programming: compiling such a function from a natural-language specification into a compact, locally-executable neural artifact. We instantiate this paradigm with Program-as-Weights (PAW), in which a 4B compiler trained on FuzzyBench, a 10M-example dataset we release, emits parameter-efficient adapters for a frozen, lightweight interpreter. A 0.6B Qwen3 interpreter executing PAW programs matches the performance of direct prompting of Qwen3-32B, while using roughly one fiftieth of the inference memory and running at 30 tokens/s on a MacBook M3. PAW reframes the foundation model from a per-input problem solver into a tool builder: invoked once per function definition, it produces a small reusable artifact whose subsequent calls per function application are cheap and offline.

한국어 요약

한 줄 요약

PAW는 자연어 명세를 기반으로 소규모 신경망 프로그램을 생성해 로컬에서 실행하는 새로운 프로그래밍 패러다임이다.

핵심 기여도

핵심 아이디어

PAW는 기존 LLM API 호출 방식의 비용과 비신뢰성을 해결하기 위해, 자연어 명세를 기반으로 소규모 신경망 프로그램을 생성하는 새로운 패러다임을 제안한다. 이는 기초 모델을 입력별 문제 해결자에서 함수별 도구 생성자로 전환한다. 핵심 아이디어는 **LoRA 어댑터**를 통해 고정된 인터프리터를 재조정하여, 별도의 API 호출 없이 로컬에서 반복 실행 가능한 신경망 프로그램을 생성하는 것이다. 이는 **pseudo-program**과 **LoRA 컴파일러**의 결합을 통해 실현되며, FuzzyBench 데이터셋을 기반으로 학습된다.

기술적 접근법

PAW는 두 단계의 컴파일 파이프라인을 사용:
1. **Pseudo 컴파일러**: 사용자 명세를 재구성한 pseudo-program과 예제를 생성.
2. **LoRA 컴파일러**: pseudo-program을 입력으로 받아 LoRA 어댑터를 생성.

주요 결과

의의 및 한계

PAW는 LLM API 의존성을 줄이고, 로컬 실행 가능성을 확보함으로써 소규모 모델 중심의 미래를 가능하게 한다. 특히, 퍼지 함수를 신경망 어댑터로 표현함으로써 기존 규칙 기반 프로그래밍의 한계를 극복한다. 그러나 PAW는 컴파일러와 인터프리터가 모두 Qwen3 기반으로 구현되어 있어, 다른 모델 아키텍처로의 확장성은 명시되지 않음. 또한, FuzzyBench 데이터셋의 품질과 범위가 PAW의 일반화 능력에 영향을 미칠 수 있다.

실용적 활용

PAW는 로그 모니터링, 의도 기반 사이트 네비게이션, 의미 기반 검색 재정렬, 에이전트 전처리, 창의적 생성 등 퍼지 함수가 필요한 다양한 산업 및 연구 분야에 적용 가능하다. 특히, API 호출 없이 로컬에서 실행 가능하므로, 오프라인 환경이나 저비용 클라이언트 기기에서 유용하게 사용될 수 있다.