Abstract
A fundamental challenge in developing semantic parsers is the paucity of strong supervision in the form of language utterances annotated with logical form. In this paper, we propose to exploit structural regularities in language in different domains, and train semantic parsers over multiple knowledge-bases (KBs), while sharing information across datasets. We find that we can substantially improve parsing accuracy by training a single sequence-to-sequence model over multiple KBs, when providing an encoding of the domain at decoding time. Our model achieves state-of-the-art performance on the Overnight dataset (containing eight domains), improves performance over a single KB baseline from 75.6% to 79.6%, while obtaining a 7x reduction in the number of model parameters.
Introduction
Semantic parsing is the process of translating natural language utterances into machine-executable logical forms. This capability is central to building natural language interfaces for databases and knowledge bases. However, a major bottleneck is the scarcity of annotated data; creating pairs of natural language sentences and their corresponding logical forms is a labor-intensive task requiring domain expertise.
Traditionally, semantic parsers are trained independently for each domain. This approach ignores the fact that while the specific entities (constants) vary between domains—such as "restaurants" in one and "publications" in another—the underlying linguistic structures and compositional patterns are often shared. For example, the phrase "no more than" indicates a comparative constraint regardless of whether it applies to square footage or author counts.
Multi-Domain Architectures
To leverage these cross-domain regularities, we explore several neural architectures based on the Sequence-to-Sequence (Seq2Seq) framework with attention. Our goal is to train a single model that can generalize across multiple knowledge bases.
- Independent (INDEP): The baseline approach where a separate model is trained for each domain.
- Domain Encoding: Our primary model, which uses a single encoder and decoder for all domains. To distinguish between domains, the decoder is provided with a domain-specific one-hot vector at every time step. This allows the model to learn a shared representation of linguistic structure while remaining grounded in the specific vocabulary of each KB.
- Many-to-Many: This architecture uses separate encoders and decoders for each domain, supplemented by a "general" encoder that processes data from all domains to capture shared patterns.
- InputToken: Similar to techniques in multilingual machine translation, a special token indicating the domain (e.g.,
<HOUSING>) is prepended to the input sentence.
To prevent the model from generating invalid tokens, we employ a constrained decoding strategy where the output is restricted to the vocabulary of the target domain.
Experimental Results
We evaluated our models on the OVERNIGHT dataset, which includes 13,682 examples across eight domains: Basketball, Blocks, Calendar, Housing, Publications, Recipes, Restaurants, and Social. The logical forms are represented in lambda-DCS, a formal language optimized for querying.
Our Domain Encoding model achieved a new state-of-the-art average accuracy of 79.6%, outperforming the independent baseline of 75.6%. Notably, this performance gain was accompanied by a 7x reduction in model parameters (from 14.1M to 2M), demonstrating the efficiency of sharing parameters across domains.
Insights: Why Multi-Domain Training Works
The success of this approach stems from the universality of compositionality. The model learns that certain syntactic structures correspond to specific logical operations, such as joins or aggregations. This structural knowledge is domain-independent.
Furthermore, multi-domain training is exceptionally effective in low-data scenarios. When trained on only 10% of the available data, our multi-domain models outperformed independent models by over 15 percentage points. This suggests that the shared structural knowledge acts as a powerful regularizer, helping the model learn from fewer examples.
Conclusion
By training a single semantic parser across multiple knowledge bases with domain encoding, we can significantly improve accuracy while reducing model complexity. This approach effectively addresses the data scarcity problem by exploiting the structural commonalities of language across different domains. Future work will focus on training from denotations and exploring character-level models to further enhance the system's flexibility and reduce annotation requirements.
Summary updated