---
title: "Code-switched inspired losses for spoken dialog representations"
description: "Code-switching-inspired pretraining helps dialogue systems recognize conversational intent and make better use of context across languages."
canonical: "https://research.elamur.ai/free/en/papers/colombo-2021-code-switched-inspired-losses-spoken/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/colombo-2021-code-switched-inspired-losses-spoken/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Code-switched inspired losses for spoken dialog representations

# Code-switched inspired losses for spoken dialog representations

Paper · 2021 · Pierre Colombo, Emile Chapuis, Matthieu Labeau et al.

**Authors:** [Pierre Colombo](https://md.research.elamur.ai/free/en/authors/pierre-colombo/), [Emile Chapuis](https://md.research.elamur.ai/free/en/authors/emile-chapuis/), [Matthieu Labeau](https://md.research.elamur.ai/free/en/authors/matthieu-labeau/) and [Chloé Clavel](https://md.research.elamur.ai/free/en/authors/chloe-clavel/) · **Year:** 2021 · **Venue:** Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **7** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/colombo-2021-code-switched-inspired-losses-spoken/cited-by/) · Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.emnlp-main.656/)
- [PDF](https://aclanthology.org/2021.emnlp-main.656.pdf)
- [DOI 10.18653/v1/2021.emnlp-main.656](https://doi.org/10.18653/v1/2021.emnlp-main.656)

## Summary

A dialogue system can work in several languages and still struggle when the language changes partway through a conversation. A question may come in one language and its answer in another. The system needs to connect those turns to understand what the speakers are doing. The authors study how to teach it to make those connections during pretraining, the stage in which it learns from large amounts of text before adapting to a particular task. They focus on code-switching between complete utterances, the individual contributions that make up a conversation.

The method treats a conversation as a sequence of utterances and an utterance as a sequence of tokens. At the lower level, the system learns to recover missing tokens from an utterance. At the higher level, it learns to reconstruct entire missing utterances from the remaining conversation. The authors use aligned translations from OpenSubtitles to create examples in English, German, Spanish, French and Italian. In one exercise, the visible conversation is in one language and the missing material must be generated in another. In the other, the visible conversation can itself contain more than one language. These exercises extend a baseline that reconstructs missing utterances from single-language conversations.

The authors evaluate the resulting representations on three kinds of task. MIAM brings together dialogue-act datasets whose labels identify what a speaker is doing, such as asking a question or acknowledging an answer. The full training combination reaches a reported total accuracy of 76.0 on MIAM, compared with 74.2 for the same hierarchical approach with only the single-language reconstruction exercise and 73.8 for multilingual BERT. On a separate test that asks the system to locate an unrelated utterance in a bilingual subtitle conversation, the full combination reaches an average accuracy of 33.4, compared with 31.2 for single-language reconstruction and 30.3 for multilingual BERT. The full combination also improves the broadest reported recall measure for retrieving the next utterance across the tested bilingual pairs. Results at the top rank vary more by pair.

MIAM tests each conversation in its original language, so its gains show that training across language changes can help even when the evaluation input stays in one language. The bilingual retrieval and inconsistency tests show what happens when the input itself changes language under controlled conditions. Those conversations are assembled from translated subtitles. The authors identify naturally code-switched dialogue with dialogue-act annotations as an important next test.

## Deep dive: Code-switched inspired losses for spoken dialog representations

Code-switching-inspired pretraining helps dialogue systems recognize conversational intent and make better use of context across languages. · about 33 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Understanding an utterance in its conversation

A dialogue act describes the function of an utterance in the exchange. A speaker might be proposing an arrangement, replying to a question or signalling agreement. The wording gives evidence for the label, and the previous turns can determine which label fits. A brief affirmative reply could acknowledge information, accept a proposal or confirm a detail. The same words can therefore have different functions depending on what the other speaker just said. The paper takes this dependence on the surrounding exchange as a starting point for spoken [dialogue systems](https://md.research.elamur.ai/free/en/topics/dialogue-systems/).

The authors distinguish evidence at the utterance level from evidence at the discourse level. Within an utterance, word choice and phrasing help identify the speaker’s immediate intention. Across utterances, the order and relationships between contributions help distinguish a response from a new initiative. The examples in the paper’s dialogue-act benchmark include a route description followed by an acknowledgment and a scheduling proposal followed by a response. Each kind of evidence has a different natural unit. A representation useful for a dialogue task should preserve the content of individual contributions and make it possible to reason about how those contributions fit together.

Spoken exchanges also contain phenomena such as fillers and disfluencies that the authors distinguish from ordinary written text. This matters when choosing training material. A system can begin with representations learned from written material, then adapt to conversational annotations. The alternative studied here is to learn directly from text that has the structure of spoken exchanges. In practical terms, the resource the authors use for the latter purpose is subtitle text. The structure they seek comes from utterances and their order, with timing used to construct stretches of conversation.

Dialogue-act tagging is the paper’s direct test of conversational function, but the authors also want to know whether a representation captures the relations between turns even when no act labels are available. They therefore draw on two other tasks from earlier work. In next-utterance retrieval, the system ranks possible continuations. In inconsistency identification, it locates an utterance that has been inserted into the wrong place. These tasks examine different consequences of using context. A system can be asked what fits after a conversation or what fails to fit inside it.

#### Supporting several languages and following a switch

A service that can handle an entire exchange in German and an entire exchange in Italian has multilingual coverage. Following an exchange in which one turn is in German and the next is in Italian places a further demand on the representation. A change of language can occur at the same point as a change of speaker or as part of a continuing contribution. The system still has to connect a response to its question, or a confirmation to the detail that preceded it. The paper distinguishes these two demands within [multilingual and cross-lingual natural language processing](https://md.research.elamur.ai/free/en/topics/multilingual-nlp/).

The authors motivate that distinction with the way bilingual speakers use their languages in different situations. Someone may use one language at work and move to another when circumstances allow it. When participants share languages, they can change languages during the exchange itself. In the paper’s experiments, the change is always between complete utterances. The authors note that research on code-switching frequently instead examines changes within an utterance, at the level of a word or a span. The narrower experimental definition makes the language change coincide with the unit that the training procedure can mask and recover.

A switch also makes a specific weakness of separate-language training easier to see. An encoder might learn useful representations for each language by processing examples in that language, and it might share parameters across languages. It can still receive all of its conversational training examples in a form where the language stays constant from beginning to end. Sharing an encoder creates a route for transfer. Presenting an exchange whose neighboring turns are in different languages gives the encoder direct practice with the situation in which that transfer is needed.

#### Where earlier pretraining stopped

The paper describes general-purpose pretraining as a way to make useful representations available for tasks with relatively small labeled datasets. An encoder first learns from data where training targets can be obtained automatically. Its parameters then provide a starting point when a researcher has labeled examples for a more specific task. MIAM includes corpora of very different sizes, which makes this motivation particularly relevant. A small dialogue-act corpus has limited examples of its own from which to learn both the structure of conversation and the distinctions in its annotation scheme.

In the authors’ account, much earlier multilingual pretraining focused on words or individual utterances. Other objectives extended single-language training to multilingual collections while retaining a flat text input and operating on each language separately. The authors cite earlier evidence of difficulty on code-switched data. Their concern is that the training unit and the language composition of the examples each leave a gap. An utterance-level representation can support comparison across languages while leaving the relations among multiple turns to be learned during downstream adaptation.

Earlier work on dialogue had already moved training beyond isolated sentences. The paper describes exercises such as finding the next turn, generating a continuation, identifying an inconsistent turn and recovering a missing one. Much of that work used English. The authors build most directly on earlier hierarchical pretraining for spoken dialogue, which already assigned separate work to the utterance encoder and the dialogue encoder. The question they add is whether the same hierarchy can learn more useful conversational representations when it has to apply information across language boundaries.

The other obstacle is the availability of examples. The authors describe existing resources for language mixing as small or concentrated in settings such as social media and written text. For their experiments they need substantial numbers of utterances in order, and they need to be able to change the language of selected turns while preserving the conversation underneath. Aligned subtitles supply that combination. Because the language of a line can be changed through its translation, the training procedure can vary the language pattern as part of constructing the exercise.

### The method, step by step

#### Build short exchanges and align their turns

The starting point is OpenSubtitles, abbreviated OPS. The paper describes the larger resource as covering 62 languages and containing 24.3G tokens. The authors select German, English, Spanish, French and Italian. They use the order and timing of subtitle lines to group them into candidate conversations, then use translation alignments to make corresponding utterances available in different languages.

For segmentation, two successive utterances stay together if the intervening silence is shorter than 6s. A resulting stretch that cannot supply a full context is discarded. The context length is 5 consecutive utterances, and the utterance length is capped at 50 tokens. The paper shows utterance-length distributions for both the processed subtitles and the dialogue-act corpora. The threshold on time and the fixed input length give the system a repeatable way to obtain short sequences from the much larger subtitle resource.

An utterance is the unit the system consumes as a turn in its input. The paper’s subtitle example has several lines attributed to the same speaker, with another speaker asking a question in the middle. An utterance boundary therefore need not coincide with a change of speaker. It gives the method a position to encode, mask or replace. This distinction also explains why the segmentation rule uses timing between subtitle lines. Its immediate job is to find nearby contributions suitable for the learning exercise.

The translation step uses alignments supplied with OpenSubtitles. A high-confidence alignment says which utterance in one language corresponds to an utterance in another. Retaining those alignments gives the authors alternative ways to fill a position within the same ordered exchange. They can keep several original utterances and replace another with its aligned translation. The dialogue then presents a different language sequence while retaining the conversational role of the translated turn.

Consider the paper’s example of a visitor asking to see an official. The visitor’s greeting is followed by the request. The other speaker asks whether the visitor has an appointment, and the visitor replies before giving a name. The paper shows the exchange with every line in English and also shows a version that keeps the greeting and appointment question in English while rendering the request and later replies in French. The mixed version comes from choosing among aligned utterances. The appointment question still has its reply in the following position, even though the two contributions now have different languages.

The size of the resource matters at two distinct stages. The processed single-language collection provides a supply of contiguous conversations in every selected language. For instance, the corpus table reports 18.2M conversations for English and 1.8M for German. The alignment table describes how much material is available for particular translation pairs, with 63.5M aligned utterances for English–Spanish and 14.1M for German–Italian. A conversation count and an aligned-utterance count describe different units. The first concerns grouping in a single language, while the second concerns the availability of alternate language versions of individual turns.

From aligned subtitles to dialogue representations The steps in order.

#### Encode words first and the conversation second

The hierarchy mirrors the way the input is assembled. The utterance encoder reads the tokens in one utterance and produces a numeric representation, generally called an embedding. The dialogue encoder reads the resulting series of utterance embeddings and produces a representation of their context. The first encoder has access to the wording inside a turn. The second receives a sequence whose elements correspond to turns. Both parts use layers of a [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/).

The paper uses a shared token vocabulary in its multilingual setting. A token is an item produced by the tokenizer, which can represent a word or a piece of a word. Sharing a vocabulary means the utterance encoder can read tokens from any of the selected languages using the same parameters. The paper compares this multilingual setup with language-specific tokenizers. Its implementation uses tokenizers based on WordPiece and [SentencePiece](https://md.research.elamur.ai/free/en/papers/kudo-2018-sentencepiece-simple-language-independent-subword/).

The notation below uses separate indices for the context and for the utterance position inside it. The collection of contexts is written as follows.

```
D = (C₁, C₂, …, C|D|)
```

Here D is the collection of training contexts. Each C is a truncated conversation, its subscript identifies which context it is, and |D| is the number of contexts. The ellipsis stands for the intervening contexts in the collection.

```
Cₖ = (u₁ᴸ¹, u₂ᴸ², …, u|Cₖ|ᴸ|Cₖ|)
```

Here Cₖ is the context indexed by k, and |Cₖ| is its number of utterances. The symbol uᵢᴸⁱ denotes the utterance at position i, with Lⁱ marking the language of that utterance. The superscript identifies a language and has no arithmetic role. The ellipsis covers every intervening utterance in conversational order.

```
uᵢᴸⁱ = (ω₁ⁱ, ω₂ⁱ, …, ω|uᵢ|ⁱ)
```

Here uᵢᴸⁱ is the same utterance, viewed as its ordered token sequence. The symbol ωⱼⁱ denotes the token at position j within utterance i. The notation |uᵢ| gives the utterance length in tokens, and each token belongs to the shared vocabulary V. When a dataset supplies dialogue-act annotations, yᵢ denotes the single act label associated with that utterance.

The utterance encoder’s output is then given by the following expression.

```
Eᵤᵢᴸⁱ = fᵘ_θ(ω₁ⁱ, …, ω|uᵢ|ⁱ)
```

Here Eᵤᵢᴸⁱ is the embedding of utterance uᵢᴸⁱ. The function fᵘ_θ is the utterance encoder, θ denotes learned parameters, and the arguments ω₁ⁱ through ω|uᵢ|ⁱ are the utterance’s tokens in order. The paper writes the resulting embedding as a vector in a real-valued space of dimension dᵤ.

```
E꜀ₖ = fᵈ_θ(Eᵤ₁ᴸ¹, …, Eᵤ|Cₖ|ᴸ|Cₖ|)
```

Here E꜀ₖ is the context embedding for Cₖ, and fᵈ_θ is the dialogue encoder with learned parameters denoted by θ. Its arguments Eᵤ₁ᴸ¹ through Eᵤ|Cₖ|ᴸ|Cₖ| are the individual utterance embeddings presented in order. The paper denotes the dimension of this context vector by dᵈ. The shared parameter notation covers the learned system, while the superscripts on the functions distinguish the jobs of its two encoders.

The hierarchy gives the pretraining procedure a place to put each kind of supervision. A missing token inside an utterance creates a problem for the lower encoder. A missing utterance creates a problem that requires representations of the visible turns and their context. The global objective combines the utterance loss and the dialogue loss.

```
ℒ(θ) = λᵤ × ℒᵤ(θ) + λᵈ × ℒᵈ(θ)
```

Here ℒ(θ) is the overall training loss at parameters θ. The function ℒᵤ is the loss at the utterance level, and ℒᵈ is the loss at the dialogue level. The coefficients λᵤ and λᵈ scale the contributions before they are added. The authors set the scaling factors to 1 after reporting that they did not observe the optimization problems that can arise when objectives have different scales.

#### Recover hidden tokens within an utterance

The lower exercise is called masked utterance modelling, or MUM. The name refers to the unit on which the operation is performed. The material hidden within that unit consists of tokens. The authors mask a proportion of the tokens, let the utterance encoder process the result, and train the system to assign probability to the original token at each masked position. This adopts the masked-token idea used by [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/).

```
p(Ω | ũᵢᴸⁱ) = ∏ₜ∈Mω pθ(ωₜⁱ | ũᵢᴸⁱ)
```

Here ũᵢᴸⁱ is the corrupted form of utterance i in language Lⁱ, and the tilde indicates that some original material has been masked. The proportion chosen for masking is denoted by pω. The set Mω contains the masked token positions, and Ω contains the original tokens at those positions. The index t runs through Mω, and ωₜⁱ is the original token at position t. Each factor pθ is the probability assigned by the system with parameters θ. The vertical bar means that the prediction uses the corrupted utterance as its input, and the product combines the probabilities for the masked positions.

For a concrete reading of the exercise, imagine that a word identifying the subject of a request is hidden but the rest of the request remains visible. The system can use those neighboring words to infer the missing token. That signal trains the utterance representation to account for the relationship among words within the turn. At the dialogue level, the same request could be hidden in its entirety, leaving the system to draw evidence from the surrounding contributions instead. The location of the mask changes what information is available for the prediction.

#### Recover missing turns from the rest of the exchange

The higher exercise removes whole utterances. From a context Cₖ, the procedure masks a proportion p꜀ of the turns to make a corrupted context. The dialogue encoder processes the visible material with the masked positions in place, and a decoder reconstructs the original utterances. It generates an utterance as a sequence, using the earlier tokens of that utterance when making each new prediction. The order of the decoder’s predictions matters here because the target is an entire line of text.

```
p(U | C̃ₖ) = ∏ₜ∈Mᵤ ∏ⱼ₌₀^|uₜ|−1 pθ(ωⱼᵗ | ω₍before j₎ᵗ, C̃ₖ)
```

Here U is the set of hidden utterances, and C̃ₖ is the conversation after masking. The outer product runs over t, the positions of those utterances in the set Mᵤ. For utterance uₜ, the inner product runs over its |uₜ| token positions, using the paper’s bounds of 0 through |uₜ|−1. The symbol ωⱼᵗ is the target at generation step j. The term ω₍before j₎ᵗ denotes the preceding token sequence within that utterance. This explicit prefix notation keeps the meaning of the conditioning sequence clear at the initial step. The decoder probability pθ uses the prefix and the corrupted dialogue as evidence. The two products combine the predictions within each reconstructed turn and across the turns selected for reconstruction.

The decoder also receives a token indicating the target language at the start of generation. The paper gives the English language identifier as 99 and the Spanish identifier as 98. The decoder therefore has an explicit instruction about how to express the missing turn. The prediction still depends on finding suitable content from context. In the multilingual exercises, generating that content can require information expressed in another language. The authors include the language token in the single-language exercise as well so the convention stays the same across training conditions.

All of the dialogue-level losses use this reconstruction mechanism. They vary in how the unmasked example is assembled and how the masked positions are chosen. Those choices determine whether the system has to read multiple languages at once, write an answer in a language absent from the visible dialogue, or infer a missing turn within a single language.

#### Change the language pattern of the reconstruction exercise

*Masked utterance generation*, or MUG, starts with a conversation in one language. The method samples positions at random and removes the utterances there. The visible exchange and the missing targets share a language. The multilingual version, mMUG, applies this exercise to conversations in different languages using a shared system. Each individual input to this exercise still has a single language. In the language-specific version, the encoder trains on the same language used for its downstream adaptation.

MUG gives the hierarchy practice at connecting turns before any language mixing is introduced. If a conversation contains an opening, a request and a response, any one of those positions can provide a reconstruction target. The surviving turns supply evidence about what kind of contribution belongs there and what information it could contain. The authors also expect a shared vocabulary and encoder to help align conversational representations across single-language examples. This is the comparison point for asking how much direct exposure to a language change adds.

*Translation masked utterance generation*, or TMUG, starts with an underlying context containing two languages. The training procedure masks every turn in one of them. The surviving text is in a single language, and the decoder has to generate the hidden material in the other language. This makes the data construction bilingual and the reconstruction cross-lingual. In the authors’ illustration, leaving English turns visible and masking selected French turns gives the decoder French targets.

The word “translation” here describes the relationship between the language of the visible evidence and the language of the answer. The decoder sees a gap instead of a source-language version of the exact turn it must reconstruct. It has to use the rest of the exchange to infer the content of the missing turn, then express the result in the specified language. Aligned subtitles make it possible to set up that target automatically. The author of the training example can choose a language for an utterance independently of the language in which its neighboring turns are shown.

*Multilingual masked utterance generation*, or MMUG, starts with a mixed-language context and selects the positions to hide at random. The rule that masks all turns in one language is lifted. The surviving evidence can therefore contain multiple languages, and separate missing turns can have different target languages. The paper describes a masking case in which one selected utterance has an Italian target and another has a Spanish target. The target-language token tells the decoder which language to use for each selected utterance.

MMUG gives the dialogue encoder direct practice in using evidence that crosses a language boundary between visible turns. The random mask also allows the available evidence to vary. A neighboring contribution may be visible in the target’s language, visible in another language or masked in the same example. TMUG supplies a more constrained cross-lingual exercise, in which the source of the visible evidence is always a single language. Using both gives the authors a way to train on both configurations while retaining the underlying representation and reconstruction scheme.

#### Train a shared encoder and adapt it to separate tasks

The authors choose one shared multilingual encoder to limit the number of learned parameters. They use the same small hierarchical Transformer configuration when comparing the dialogue-level losses. The paper reports 80 million parameters for that architecture and gives 167 million parameters for the original BERT comparison. The hierarchical setting limits the number of input utterances as well as the tokens per utterance. The experiments use a dropout rate of 0.1 and GELU activations.

For pretraining, the paper reports 500k iterations over 2 days on 4 NVIDIA V100 GPUs, with a batch size of 256. The optimizer is AdamW, with 4000 warmup steps. The objective weights are kept fixed, and the authors do not run a pretraining grid search. These details describe the training regime for the hierarchical approach. The previously pretrained BERT baselines bring their own training histories to the comparison.

At the downstream stage, the paper uses [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/). The pretrained encoder is adapted together with the task’s prediction component. The authors set dropout to 0.1 and select the learning rate using validation loss, considering 0.01, 0.001 and 0.0001. The prediction component changes with the task. For dialogue acts it predicts an annotation for each utterance. For inconsistency it predicts a position in the context. For retrieval it assigns a score to a context paired with a candidate continuation. The generation decoder supports the pretraining exercise, while these task-specific components determine what is measured in evaluation.

### Experiments and results

#### What the evaluations ask the system to do

The paper separates the language coverage of an evaluation from the language composition of a particular example. The monolingual-input group includes separate evaluations in the selected languages, each using dialogues that remain in one language. This group covers dialogue-act labeling, next-utterance retrieval and inconsistency identification. The multilingual-input group mixes languages inside individual subtitle contexts and tests retrieval and inconsistency. The distinction makes it possible to ask both whether the training transfers across corpora in different languages and whether it helps when consecutive turns change language.

The dialogue-act evaluation uses annotated corpora assembled into MIAM. The subtitle evaluations are generated from held-out material. The authors describe constructing training, validation and test datasets of 5k conversations for each bilingual task. The held-out conversations used for these tasks are unseen during pretraining. The training exercises and the downstream predictions differ as well. Pretraining reconstructs hidden material, while evaluation asks for a label, a ranking or the location of a substituted utterance.

The main comparisons include hierarchical recurrent encoders with gated recurrent units, referred to as HR, and pretrained BERT encoders. On the dialogue-act task, the paper compares BERT systems with language-specific tokenizers and versions that use a multilingual tokenizer. It also compares full BERT encoders with versions reported as 4 layers. The hierarchical recurrent baselines can use a conditional random field, which accounts for relations among predicted labels, or a multilayer perceptron, which makes predictions from numerical representations. A recurrent decoder is also among the dialogue-act options explored. The paper’s generative objectives are evaluated with a common hierarchical Transformer encoder.

For the BERT comparisons, the authors concatenate the utterances to obtain a conversation representation. For the hierarchical approach, the dialogue encoder instead operates on the utterance embeddings. These differences are part of what the external baseline comparisons measure. The comparisons between mMUG and its augmented variants give more direct evidence about the effect of the training objectives because they keep the hierarchical architecture in place.

#### Dialogue acts across the MIAM corpora

The MIAM benchmark brings together existing annotations from different conversational settings. In the English MapTask corpus, one speaker helps another reproduce a route through spoken directions. The paper reports 27k utterances and selects the resource in part because its size makes transfer useful. An instruction, a request for clarification and an acknowledgment can each have a distinct role in that interaction, even when the utterances are very short.

The Spanish Dihana material consists of 900 dialogues from 225 users and was collected using a Wizard of Oz setup, in which a person helps simulate the system during the interaction. The paper uses the first layer of the annotation, which is intended to capture task-independent dialogue acts. The German VM2 corpus comes from appointment scheduling and has 31 domain-dependent labels. The authors highlight informing, suggesting and giving feedback among its frequent functions. These two choices expose the benchmark to substantially different label schemes even when both datasets feature task-oriented speech.

For French, the authors use LORIA, with approximately 1250 dialogues and 10,454 utterances. Its annotation set contains 31 labels. The Italian Ilisten corpus comes from another Wizard of Oz setting. The paper reports 60 dialogue transcripts and a 15-label inventory, with annotations in exchanges containing both user and system turns. Across MIAM, the annotation unit is the utterance. The meaning and distribution of the labels come from each corpus’s own scheme.

The prediction is evaluated with accuracy, the proportion of utterance labels assigned correctly. The authors note that earlier work used different metrics for related annotation tasks, including weighted F-score, and follow the accuracy convention of the hierarchical pretraining work on which they build. Their results table gives an accuracy for each corpus and a reported total. The following comparison uses the total column from that table.

Total dialogue-act labeling accuracy on MIAM The hierarchical system reaches its highest total accuracy with both cross-language objectives.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Multilingual hierarchical recurrent encoder with MLP | 73.1 |
| Multilingual BERT, reduced depth | 73.4 |
| Multilingual BERT | 73.8 |
| mMUG | 74.2 |
| mMUG with TMUG | 75.4 |
| mMUG with MMUG | 75.8 |
| mMUG with TMUG and MMUG (this paper) | 76.0 |

The strongest total belongs to the training combination that includes both added objectives. A reader interested in a particular corpus will find a more varied ordering. German VM2 reaches 56.2 with mMUG plus MMUG and also with the full combination. The Spanish Dihana accuracy of 99.3 belongs to the full combination. On French LORIA, mMUG plus TMUG reaches 80.8, while the full combination reaches 80.7. On Italian Ilisten, the combination with MMUG alone reaches 77.6, and the full combination reaches 77.0. In English MapTask, either added objective alone gives 67.4, compared with 66.7 for the full combination.

Those rows measure different prediction problems. Dihana uses a selected layer of annotations, VM2 has scheduling-specific labels, and the sizes and distributions of the corpora vary. A higher accuracy on one corpus gives little basis for ranking the conversational competence required by its language against another. The within-corpus comparisons show where a change of training objective alters the score. The total summarizes performance across the collection. MIAM is available through the Datasets library.

#### Finding a misplaced turn

For inconsistency identification, the authors take a genuine sequence of utterances and replace one utterance with a negative example. The system receives the modified conversation and must identify the replaced position. In the bilingual task, some original utterances are first exchanged for their aligned translations. The negative utterance comes from the same movie. The resulting input can therefore include a legitimate change of language alongside the substitution that the system is meant to find.

The downstream encoder produces a context embedding, and a multilayer perceptron uses it to predict the index. The training loss is cross-entropy over the possible positions, which assigns a penalty according to the probability given to the correct index. At evaluation, a prediction is correct if it identifies the substituted position. With the context length set to 5, the paper gives 20% accuracy for a uniformly random guess. The chance level is the same in the monolingual and bilingual tests because they have the same number of possible positions.

On the monolingual subtitle test, multilingual BERT reaches an average accuracy of 43.4 and mMUG reaches 43.9. Adding TMUG raises the reported average to 45.5, while adding MMUG gives 45.8. The full combination reaches 46.0. The best setting for German is mMUG plus MMUG at 49.6. For Italian, the full training combination reaches 45.1, the highest value reported in that language’s row. A system can learn from cross-language reconstruction and apply the representation to coherence judgments completely within one language.

The bilingual averages are lower. The full combination records 33.4, and multilingual BERT records 30.3. Short contexts with inserted turns present several possible sources of evidence about the displacement, and changes of language add another distinction for the system to handle. The experiment measures whether it can locate the position selected by the construction procedure. The average comparison below uses the values reported across the bilingual pairs.

Average inconsistency identification accuracy on bilingual OpenSubtitles contexts The full reconstruction combination locates more substitutions on average than the other tested settings.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Multilingual hierarchical recurrent encoder | 28.3 |
| Multilingual BERT, reduced depth | 30.1 |
| Multilingual BERT | 30.3 |
| mMUG | 31.2 |
| mMUG with TMUG | 31.8 |
| mMUG with MMUG | 32.9 |
| mMUG with TMUG and MMUG (this paper) | 33.4 |

The full combination exceeds multilingual BERT on every bilingual pair reported for inconsistency identification. German–English gives 35.7 for the full combination against 31.2 for multilingual BERT. Italian–French, listed as French–Italian in the results, gives 32.1 against 28.7. The strongest setting within the hierarchical comparisons can still depend on the pair. For German–French, mMUG plus MMUG reaches 34.0, while the full combination gives 32.5. English–French provides another informative pattern. The single-language reconstruction setting gives 33.1, the addition of TMUG gives 32.9, the addition of MMUG gives 32.8, and the combination of both reaches 33.6. The average describes a tendency across pairs whose individual responses to the extra training vary.

#### Ranking a possible continuation

Next-utterance retrieval presents a context and several possible continuations. One is the observed next utterance, and the others are distractors. In the bilingual task, the authors construct the mixed-language context by replacing some utterances with aligned translations. Distractors can be in either of the languages and come from the same movie. The paper sets the number of distractors to 9, so the task has a known answer against which the ranking can be scored.

The system represents the context and the candidate utterance separately. Their embeddings are concatenated and passed to a multilayer perceptron. During fine-tuning, the predictor learns to identify a suitable continuation using binary cross-entropy, which penalizes assigning a low probability to the correct suitability judgment. At test time, scores for the candidates determine their rank. Generation is useful here because the pretraining has required the encoder to preserve information about possible missing utterances. The measured output is a ranking of supplied lines.

The metric is recall at a specified rank, abbreviated R@N. In this experiment it is the fraction of cases in which the observed continuation is among the first N candidates. R@1 requires the continuation to be ranked first. R@2 and R@5 allow broader candidate sets and show whether the system can place the answer near the top even when it prefers another candidate. For the random ranking baseline, the paper reports 0.10 for R@1, 0.20 for R@2 and 0.50 for R@5. The results tables express scores on a percentage scale.

For monolingual inputs, the full combination reaches the highest reported R@5 in each language. English R@5 is 68.9 for that setting and 62.1 for multilingual BERT. Spanish R@5 is 69.3 and 62.4, respectively. Italian R@5 reaches 70.2 for the full setting, with 66.1 for multilingual BERT. On English R@2, the best score is instead 29.8 for mMUG plus TMUG, compared with 27.8 for the full combination. For French R@1, mMUG plus MMUG ties the full combination at 17.4. The metric cutoff matters when deciding which setting performs best.

The bilingual R@5 values tell a consistent story against the external baselines. The full training combination exceeds multilingual BERT in every reported pair. For German–English the scores are 61.0 and 54.4, respectively. For English–Spanish they are 64.3 and 55.4. Spanish–French gives 66.1 with the full combination and 57.8 with multilingual BERT. German–Italian and French–Italian are cases where an augmented setting ties the full combination at this cutoff. The following chart shows the Spanish–French comparison across the main settings.

Next-utterance retrieval recall at five on Spanish–French OpenSubtitles contexts The full training combination ranks the observed continuation among the first candidates most often in this pair.

**The numbers**

| System or setting | R@5 % |
| --- | --- |
| Multilingual hierarchical recurrent encoder | 54.9 |
| Multilingual BERT, reduced depth | 57.1 |
| Multilingual BERT | 57.8 |
| mMUG | 64.6 |
| mMUG with TMUG | 64.9 |
| mMUG with MMUG | 65.0 |
| mMUG with TMUG and MMUG (this paper) | 66.1 |

Bilingual top-rank retrieval gives a more qualified result. On German–Spanish, multilingual BERT obtains 11.9 for R@1, and its reduced-depth version obtains 12.4. The full combination gives 11.7. For English–French, mMUG plus MMUG achieves 14.7 at the top rank, compared with 14.1 for the full combination, even though the full combination has the higher R@5. The broad-cutoff gains are evidence that training helps bring the observed next turn into a plausible group. The top-rank rows show how often the system resolves the remaining choice in favor of that particular turn.

### What the ablations show

#### Cross-language generation helps on its own

The loss comparison starts from a useful control. With mMUG, the hierarchy has already seen conversations in each of the selected languages, has learned to reconstruct complete turns and uses a shared multilingual tokenizer. Adding TMUG changes the training examples so that the visible context and the targets come from different languages. The resulting improvement on MIAM shows that direct practice in cross-language reconstruction can help a task with single-language inputs. A multilingual visible context is unnecessary for that particular improvement because TMUG masks all the target-language turns.

Looking down the MIAM rows shows where this control is informative. German VM2 goes from 53.0 with mMUG to 54.8 when TMUG is added. French LORIA goes from 78.5 to 80.8. Those are two separate gains on annotated dialogues with different label schemes. The mechanism proposed by the authors is that learning to reconstruct turns across languages helps the hierarchy encode information useful to speaking intentions and contextual relations. The experiment measures the resulting predictions. It does not expose which cues in either corpus the encoder has learned to use.

The causal interpretation applies to the change in training configuration as a whole. Introducing TMUG changes the use of aligned data along with the relationship between the visible language and the target language. The comparison shows the effect of adding that exercise to mMUG. It cannot isolate whether the additional aligned examples, their bilingual construction or their particular mask rule accounts for the gain. This distinction matters because a later experiment concerned with mechanism would need controls over those aspects individually.

#### Mixed visible turns add a different condition

The MMUG comparison asks what changes when the language used for the visible evidence can itself vary across turns. Its masking rule also changes which targets are hidden. The authors interpret the relatively small total improvement of MMUG over TMUG on MIAM as suggesting that cross-language generation accounts for much of the benefit. Bilingual inconsistency identification gives a clearer ordering in the average results. The average of 32.9 with MMUG exceeds the 31.8 with TMUG. The finding is consistent with the training and evaluation inputs having more in common when both can show the encoder a language switch directly.

Individual rows make it possible to assess how uniform that pattern is. German–English bilingual inconsistency accuracy is 34.5 with mMUG, 34.0 with TMUG added and 35.1 with MMUG added. On Spanish–Italian the corresponding values are 32.0, 33.0 and 33.9. For English–French the individual additions yield lower accuracy than mMUG, and using them together gives the highest row value. There is evidence for an average advantage of mixed-input training within this task, with the differences by pair limiting any stronger claim that the same exercise will help each pair by the same mechanism.

Using both losses gives the best total on MIAM and the highest bilingual inconsistency average. The authors read the combined result as evidence that the exercises capture different patterns. The design makes that interpretation plausible. TMUG guarantees cross-language prediction for a particular direction in an example, whereas MMUG makes the language relationship among visible turns variable and can require different output languages within the same context. The full combination provides evidence of joint usefulness. A complementary pattern in aggregate, such as the improvement from adding both, leaves open which features or examples account for the effect.

#### Tokenizer comparisons depend on the encoder

The dialogue-act table also varies the tokenizer and the scope of pretraining. Among hierarchical recurrent baselines, the multilingual-tokenizer versions outperform their language-specific counterparts in the reported total for either of the listed prediction heads. With a conditional random field, the total is 72.8 for the multilingual system and 69.4 for the language-specific one. With a multilayer perceptron, the corresponding values are 73.1 and 66.8. The authors had expected language-specific segmentation to help systems trained from scratch, and suggest that the spoken character of the benchmark might be relevant. They leave the explanation for future investigation.

The comparison goes the other way for the basic hierarchical reconstruction setting. The language-specific MUG total is 74.6, while the shared mMUG total is 74.2. The former trains and adapts an encoder on the same language as the downstream corpus. The authors suggest the limited capacity of the shared architecture as a possible explanation and also discuss tokenizer quality. The setting changes both the scope of training and the vocabulary, so the table establishes how the two configurations perform as packages. It does not show how much of the ordering comes from either choice alone.

The language-specific BERT comparisons are also sensitive to the corpus. On Dihana, the language-specific BERT scores 86.0 and multilingual BERT scores 98.7. On LORIA the values are 50.2 and 76.2. These entries come from independently pretrained encoders. The authors discuss differences in pretraining quality as a possibility. Because those comparisons use systems with different training histories, they cannot establish a general effect of replacing a multilingual tokenizer with a language-specific one.

#### Subtitle pretraining and the choice of written baseline

The appendix reports a separate ablation that compares utterance representations derived from written-text BERT with ones obtained by training on the subtitle corpus. The written condition takes the representation of the classification token from BERT’s second layer. The subtitle condition trains the hierarchical system on OpenSubtitles with the utterance-level loss only. The prediction is made from the utterance embeddings using a multilayer perceptron. Restricting the subtitle condition to the utterance loss gives the authors a way to study the usefulness of the pretraining source before considering the full set of dialogue exercises.

The written condition gives a MIAM total of 73.2, and the subtitle-trained condition gives 74.2. The English MapTask results are 64.6 and 67.3, respectively. For French LORIA, the results are 76.5 and 78.5. Italian Ilisten gives 74.2 in the written condition and 74.0 with subtitle pretraining. The total supports the authors’ decision to use subtitles to learn representations for spoken dialogue, while the Italian row shows that the advantage in this comparison does not extend to every corpus.

This ablation links training source to downstream performance within the designs tested. The written condition uses a specific representation from a pretrained BERT encoder, and the subtitle condition is trained with the paper’s utterance objective. Their distinct representation and training procedures prevent a clean estimate of the effect of changing the source text alone. The result is most informative as support for the authors’ practical choice of pretraining setup. It offers less direct evidence about what would happen if the training source were swapped with every other part of the procedure held fixed.

### Limitations

#### Limits identified by the authors

The authors restrict a language switch to the boundary between utterances. They propose refining the subtitle alignments to the level of words and spans so that future exercises could also involve changes within a turn. This would change both the data construction and what the system is asked to interpret. In the present setup, each utterance has a language designation, and the generation decoder receives a token identifying the target language. An utterance containing multiple languages would require a finer account of which spans to preserve, replace or generate.

The authors also point to the absence of an annotated benchmark for naturally code-switched spoken dialogue. MIAM provides dialogue-act labels, but each corpus evaluates input in one language. The bilingual subtitle experiments provide mixed input, but their labels come from choosing a continuation or inserting a displaced turn. A new dialogue-act resource with actual language switches would join properties that the current evaluation handles in separate tasks. The authors specifically connect that goal with interactions in which someone has difficulty expressing an intention in the language a voice assistant expects.

They limit the study to English, German, Spanish, French and Italian. OpenSubtitles has much broader coverage, and the authors describe extending the construction to 62 languages as feasible while expressing concern about multilingual capacity. That is a statement about the design’s possible reach. The experiment measures the tradeoffs of a shared architecture in the selected languages. Broader coverage would also depend on the quantity and confidence of the alignments available, since these alignments determine which turns can be substituted in the multilingual training examples.

The appendix notes that retrieval and inconsistency can be made harder through the choice of negatives. A negative chosen for its similarity to the observed utterance would force a more exact distinction than a casually related line might. The experiments use the paper’s chosen sampling procedure. The more demanding selection strategy is proposed as a way of adjusting the tasks once the existing ones cease to distinguish useful performance levels. The authors also name emotion recognition, multimodal pretraining and generation as possible future applications of the learned representations.

#### Limits visible in the evaluation design

The subtitle construction controls one aspect of code-switching particularly well. A translated utterance can be placed in the same position while preserving its role in the conversation. Consequently, the experiment can vary which language the encoder sees without deliberately changing the question, answer or request being expressed. The same control limits what can be learned about language switching as social behavior. The location of a switch follows an example-construction rule. The experiment gives no measure of whether people in the depicted situation would choose to switch at that point or whether their choice of language would alter the function of the turn.

Subtitle segmentation adds a related limitation. The 6s timing threshold makes it possible to gather short contexts at scale. Whether the resulting stretch forms a self-contained conversational unit is a different question. A timing rule can group neighboring subtitle lines without identifying where a participant’s goal or a topic begins and ends. The fixed length of 5 utterances also restricts what the experiment can establish about longer dependencies. A prediction can make effective use of nearby turns while leaving unresolved whether the same representation could track an intention established much earlier.

The automatic tasks provide clear labels because their construction fixes the correct answer. In inconsistency identification, the correct index is wherever the sampled utterance was inserted. A real conversation may contain a surprising but legitimate contribution, and a randomly inserted line can sometimes fit better than intended. Using a negative from the same movie makes the source more comparable, but the experiment does not show which features the predictor used to identify it. Different candidates could reveal a dependence on vocabulary, a mismatch in conversational function or another cue. An accuracy score on its own cannot distinguish among these explanations.

Retrieval has a similar boundary. The observed continuation is the correct candidate for evaluation, although the preceding context could admit several reasonable responses. Ranking the observed line within a supplied candidate set accordingly measures sensitivity to the continuation chosen by the dataset construction. It provides limited evidence about an assistant’s ability to compose an appropriate response in an open interaction. The distinction between R@1 and R@5 is also consequential. The extra training helps reliably with the broader cutoff in the bilingual comparisons. A claim about consistently choosing the best single response would require a corresponding pattern at the top rank.

MIAM’s cross-language scope involves variation in domain, label inventory and corpus size. A change in accuracy between MapTask and VM2 cannot be assigned to language alone because the conversational activity and annotation scheme change as well. The benchmark checks how a representation adapts to several tasks with their own labels. It provides no common inventory for a label-by-label comparison across languages, and the reported accuracy does not show which rare acts benefited. The gain on MIAM is evidence of transfer to the tasks included in the benchmark. Bilingual dialogue-act labeling remains open.

The full training combination wins several aggregate comparisons, but baseline differences affect what can be attributed to the losses. Multilingual BERT has a different way of encoding the conversation and a different pretraining history. The comparisons within the hierarchical family give a closer test of the objectives. Even there, adding an exercise changes several properties of the input and target together. The reported results establish the value of the tested training combinations under the paper’s data and evaluation procedures. They give an incomplete account of the particular features of cross-language conversation that produced the gains.

### What came after

The later citing work listed for this paper is a benchmark about evaluating story generation through human criteria and automatic metrics. Its task is connected to one of the directions the authors mention in their conclusion. They suggest exploring the use of their dialogue representations in automatic evaluation of generated text. The story benchmark’s title identifies evaluation as its subject, while the cited dialogue paper studies a representation learned from turn reconstruction and tests it on dialogue acts, retrieval and inconsistency. The documented connection is the citation. Whether the benchmark implemented, compared or extended the code-switching-inspired objectives is unspecified. [Of Human Criteria and Automatic Metrics](https://md.research.elamur.ai/free/en/papers/chhun-2022-human-criteria-automatic-metrics-benchmark/)

## Cite

Cite as Pierre Colombo, Emile Chapuis, Matthieu Labeau and Chloé Clavel. 2021. Code-switched inspired losses for spoken dialog representations. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2021.emnlp-main.656](https://doi.org/10.18653/v1/2021.emnlp-main.656)

```bibtex
@inproceedings{colombo2021code,
  title = {{Code-switched inspired losses for spoken dialog representations}},
  author = {Pierre Colombo, Emile Chapuis, Matthieu Labeau and Chloé Clavel},
  booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.656},
  url = {https://doi.org/10.18653/v1/2021.emnlp-main.656}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
