Abstract
dc:description.abstractAI systems have shown impressive performance across a wide range of tasks. Part of this has been driven by a shift toward compound AI systems, composed of one or more AI models and programmatic components. Latency is a key concern for these systems, and there are many opportunities to parallelize and stream model calls. However, manually doing so greatly increases code complexity, intertwining high-level algorithms with low-level performance optimizations. In this thesis, we propose providing parallelization and streaming automatically for high-level, sequential code via an approach called opportunistic evaluation. First, we develop its theory, introducing a novel calculus, λO, providing sound, out-of-order execution of general-purpose programs that make external calls, such as those to AI models. We then describe a language, Opal, which offers automatic parallelization and streaming, and we demonstrate its ability to express and optimize a wide range of compound AI systems, improving performance by up to 12.7×. Next, we build a system, PopPy, which automatically parallelizes Python programs, and we show that it can express 5 compound AI systems from the literature with minimal modifications, yielding speedups of up to 6.4×. Finally, we build an extensible language, Quasar, for code generated by AI models and show that it can provide latency, security, and reliability improvements, without accuracy degradation. Together, these show how opportunistic evaluation can provide significant benefits to compound AI systems written in general-purpose programming languages.
Degree
thesis:*- Department dc:contributor.department
- Computer and Information Science
- Year dc:date.issued
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Mell, Stephen
- Advisors dc:contributor.advisor
-
- Bastani, Osbert
- Zdancewic, Steve
Subjects
dc:subject × 1Rights
- Language dc:language.iso
- en
Identifiers
dc:identifier.*- Repository record dc:identifier.uri
- https://repository.upenn.edu/handle/20.500.14332/62823