English

Relational Programming with Foundation Models

Artificial Intelligence 2024-12-20 v1 Programming Languages

Abstract

Foundation models have vast potential to enable diverse AI applications. The powerful yet incomplete nature of these models has spurred a wide range of mechanisms to augment them with capabilities such as in-context learning, information retrieval, and code interpreting. We propose Vieira, a declarative framework that unifies these mechanisms in a general solution for programming with foundation models. Vieira follows a probabilistic relational paradigm and treats foundation models as stateless functions with relational inputs and outputs. It supports neuro-symbolic applications by enabling the seamless combination of such models with logic programs, as well as complex, multi-modal applications by streamlining the composition of diverse sub-models. We implement Vieira by extending the Scallop compiler with a foreign interface that supports foundation models as plugins. We implement plugins for 12 foundation models including GPT, CLIP, and SAM. We evaluate Vieira on 9 challenging tasks that span language, vision, and structured and vector databases. Our evaluation shows that programs in Vieira are concise, can incorporate modern foundation models, and have comparable or better accuracy than competitive baselines.

Keywords

Cite

@article{arxiv.2412.14515,
  title  = {Relational Programming with Foundation Models},
  author = {Ziyang Li and Jiani Huang and Jason Liu and Felix Zhu and Eric Zhao and William Dodds and Neelay Velingker and Rajeev Alur and Mayur Naik},
  journal= {arXiv preprint arXiv:2412.14515},
  year   = {2024}
}
R2 v1 2026-06-28T20:41:37.769Z