Natural Language Multitasking: Analyzing and Improving Syntactic Saliency of Hidden Representations

Gino Brunner, Yuyi Wang, Roger Wattenhofer, Michael WeigeltarXiv 2018

Introduction

In the field of Deep Learning, representation learning aims to transform complex data—such as images or sentences—into mathematical vectors that capture their essential features. While significant progress has been made in image style transfer and word-level embeddings (e.g., Word2Vec), creating robust and structured representations for entire sentences remains a significant challenge.

Standard models are typically trained on single tasks, such as translating English to German. However, researchers from ETH Zurich argue that single-task models often focus too narrowly on task-specific patterns, failing to capture the underlying syntactic rules of a language. This paper explores whether forcing a model to perform multiple linguistic tasks simultaneously can induce a more robust, "disentangled," and syntactically salient latent space.

Methodology: The Multi-Task Autoencoder

The researchers developed a multi-task autoencoder framework based on Long Short-Term Memory (LSTM) networks. The architecture follows a "hub-and-spoke" model designed to consolidate diverse linguistic information into a single bottleneck.

  1. The Encoder: A character-level LSTM processes an English sentence, compressing it into a fixed-length "representation vector."
  2. The Decoders: This central vector is fed into multiple independent decoder LSTMs, each assigned a specific task:
  3. REP: Reconstructing the original English sentence (standard autoencoding).
  4. DE/FR: Translating the input into German or French.
  5. POS: Predicting Part-of-Speech (POS) tags for each word in the sentence.
Architectural diagram of the multi-task sequence-to-sequence model, showing the flow from an English sentence to a shared representation vector and subsequent task-specific decoders.

By increasing the number of decoders, the model is forced to encode enough information in the central vector to satisfy multiple linguistic requirements, preventing it from "cheating" by relying on shallow, task-specific heuristics.

Results: Syntactic Saliency and Latent Space Organization

The most striking finding is that multi-tasking acts as a powerful "disentangler" for the latent space. In single-task models, sentences with different syntactic structures often overlap in the vector space. However, as more tasks—particularly POS tagging—are added, the latent space naturally organizes itself into distinct clusters based on syntax.

Using t-SNE visualizations, the authors demonstrated this shift from messy, overlapping data points to clear, isolated "islands" corresponding to specific syntactic prototypes. Quantitatively, the clustering error rate (measured via K-means on 14 syntactic prototypes) dropped from 51 in the single-task (REP) model to 0 in the most advanced multi-task model (REP-DE-POS). This indicates that the multi-task approach allows the model to perfectly separate different sentence structures.

t-SNE visualization of syntactic prototypes in the latent space. The left panel shows the disorganized space of a single-task model, while the right panel shows the perfectly clustered space of the multi-task model.

Discussion: Sentence Arithmetic and Interpolation

The organized nature of the multi-task latent space enables "sentence arithmetic," similar to the famous "King - Man + Woman = Queen" example in word embeddings. For instance, the model's latent space is structured enough that subtracting the vector for "I am two" from "I am one" and adding "You are two" results in a vector very close to "You are one."

Furthermore, the quality of interpolation—moving smoothly between two points in the latent space—is significantly higher in multi-task models. While single-task models often generate gibberish when interpolating between sentences, multi-task models produce plausible "pseudo-English" that maintains structural integrity throughout the transition.

Conclusion and Future Work

This research demonstrates that explicit syntactic supervision, specifically through multi-tasking with POS tagging, is a key ingredient for creating organized sentence representations. While the current model excels at capturing syntax, the authors note that it does not yet focus on deep semantics (meaning). Future work may involve utilizing Variational Autoencoders (VAEs) to further smooth the latent space and incorporating more specialized semantic tasks to capture meaning as effectively as the current model captures structure. Such advancements could eventually power more sophisticated and creative AI applications, such as automated poetry or fiction writing.

Summary updated

Abstract

We train multi-task autoencoders on linguistic tasks and analyze the learned hidden sentence representations. The representations change significantly when translation and part-of-speech decoders are added. The more decoders a model employs, the better it clusters sentences according to their syntactic similarity, as the representation space becomes less entangled. We explore the structure of the representation space by interpolating between sentences, which yields interesting pseudo-English sentences, many of which have recognizable syntactic structure. Lastly, we point out an interesting property of our models: The difference-vector between two sentences can be added to change a third sentence with similar features in a meaningful way.
BibTeX
@misc{brunner2018natural,
  author = {Gino Brunner and Yuyi Wang and Roger Wattenhofer and Michael Weigelt},
  title = {{Natural Language Multitasking: Analyzing and Improving Syntactic Saliency of Hidden Representations}},
  year = {2018},
  eprint = {1801.06024},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1801.06024},
}
Figure