Towards Zero-Shot Functional Compositionality of Language Models

Hangyeol Yu, Myeongho Jeong, Jamin Shin, Hyeongdon Moon, Juneyoung Park, Seungtaek ChoiarXiv 2023 · DOI

Abstract

While Large Language Models (LLMs) demonstrate remarkable proficiency in individual tasks such as translation and summarization, their ability to combine these capabilities "zero-shot" remains a significant challenge. This paper investigates functional compositionality—the capacity of a model to treat learned tasks as mathematical functions and compute their composition in a single pass. Through experiments on the StylePTB and WikiLingua benchmarks, we demonstrate that while standard models struggle with zero-shot composition, compositionality itself is a learnable meta-skill. However, significant gaps remain in transferring this skill across diverse domains.

1. Introduction

In linguistics, semantic compositionality describes how the meaning of a complex expression is derived from its constituent parts. We propose an analogous concept for model capabilities: functional compositionality. This is the ability to take two atomic tasks, $f$ and $g$, and perform the composite task $g \circ f$ (e.g., cross-lingual summarization) without explicit training on that specific combination.

Functional compositionality illustrated: A model performs a composite task by chaining atomic functions like summarization ($f$) and translation ($g$).

Currently, complex tasks are typically handled via a Pipeline Approach (sequential execution of multiple models) or an End-to-End Approach (training on specific composite datasets). The former is computationally expensive and prone to error compounding, while the latter is data-inefficient and fails to scale to the vast space of possible task combinations.

2. Methodology

We evaluated three primary strategies for enabling functional compositionality in Pre-trained Language Models (PLMs) like T5 and GPT-2:

  • Prompt Composition (PROMPT): Concatenating task-specific prompts (e.g., summarize + translate_to_french: [text]).
  • Prefix Tuning (PREFIX): Learning small, task-specific "prefix" vectors. We introduced a Composer—a learnable self-attention layer—to merge these prefixes for composite tasks.
  • Learn to Compose (L2C): A training strategy where the model is exposed to a subset of composite tasks to learn the underlying logic of task chaining, which is then tested on entirely unseen combinations.

3. Experimental Results

3.1 StylePTB: Composition as a Learnable Skill

On the StylePTB dataset, which involves fine-grained text style transfers (e.g., changing tense and removing adjectives), we found that standard zero-shot performance is poor. The Zero-shot PROMPT method achieved an average Exact Match (EM) score of only 39.31%.

However, the introduction of the L2C strategy yielded a dramatic improvement. As shown in the figure below, models trained on a variety of compositions (the "Hold-1-out" setting) achieved an EM score of 79.57%, nearing the Full-shot performance of 87.59%. This suggests that "how to chain tasks" is a distinct, learnable skill separate from the execution of the tasks themselves.

Performance comparison of various composition strategies on the StylePTB dataset. The 'Learn to Compose' (L2C) settings significantly outperform pure zero-shot approaches.

3.2 The Pipeline Baseline and Order Sensitivity

The PIPELINE method (performing tasks sequentially) remained a strong baseline with 86.55% EM. However, it exhibited extreme sensitivity to task order. For instance, attempting to change a sentence from passive to active voice after removing a prepositional phrase often resulted in logical failure, whereas the reverse order succeeded.

3.3 WikiLingua and the Transferability Gap

In the more complex WikiLingua benchmark (cross-lingual summarization), the L2C approach failed to significantly outperform zero-shot baselines. This highlights a "transferability gap": while models can learn to compose simple style-transfer tasks, they struggle to apply that compositional logic to more complex, real-world linguistic transformations.

4. Discussion and Conclusion

Our findings indicate that functional compositionality is not an emergent property of current PLMs but can be taught as a meta-skill. While the L2C strategy shows promise for domain-specific composition, achieving universal, zero-shot compositionality remains an open problem.

Future work should explore baking compositionality into the pre-training phase—perhaps by training on "pipeline-style" data—and investigating task decomposition, where models explicitly break down complex prompts into atomic sub-tasks before execution.

Summary updated

BibTeX
@misc{yu2023towards,
  author = {Hangyeol Yu and Myeongho Jeong and Jamin Shin and Hyeongdon Moon and Juneyoung Park and Seungtaek Choi},
  title = {{Towards Zero-Shot Functional Compositionality of Language Models}},
  year = {2023},
  eprint = {2303.03103},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.03103},
}
Figure