---
title: "Unveiling Multilinguality in Transformer Models: Exploring"
description: "A study of which feed-forward neurons respond to Czech and English in XGLM, and how the balance of shared and language-specific activity…"
canonical: "https://research.elamur.ai/free/en/papers/bhattacharya-2023-unveiling-multilinguality-transformer-models-exploring/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **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/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bhattacharya-2023-unveiling-multilinguality-transformer-models-exploring/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2023](https://md.research.elamur.ai/free/en/papers/2023/) / Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks

# Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks

Paper · 2023 · Sunit Bhattacharya and Ondřej Bojar

**Authors:** Sunit Bhattacharya and [Ondřej Bojar](https://md.research.elamur.ai/free/en/authors/ondrej-bojar/) · **Year:** 2023 · **Venue:** Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **9** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/bhattacharya-2023-unveiling-multilinguality-transformer-models-exploring/cited-by/) · Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.blackboxnlp-1.9/)
- [PDF](https://aclanthology.org/2023.blackboxnlp-1.9.pdf)
- [DOI 10.18653/v1/2023.blackboxnlp-1.9](https://doi.org/10.18653/v1/2023.blackboxnlp-1.9)

## Summary

When a multilingual text generator reads the same message in Czech and English, which parts of its network respond to both versions? Sunit Bhattacharya and Ondřej Bojar study this question in XGLM by examining its feed-forward networks, the parts of a Transformer that transform the representation at each token position. The authors call the individual units at the entrance to these networks *detectors*. A detector receives a representation of the text so far and produces a signal that can influence the prediction of the next token. The authors ask whether the strongest signals tend to come from the same detectors in both languages and whether the answer changes from the first layers to the last.

The experiment uses Czech and English translations drawn from the training portion of CzEng 2.0. The researchers present each sentence as a series of progressively longer beginnings, adding a sub-word at each step. For every beginning, or *prefix*, they record the response of each detector and rank the detectors within each layer. Pooling the highest-ranked detectors across prefixes reveals which units reach the leading group in Czech, in English, or in both. A complementary test asks how accurately a linear classifier can recover the language of a prefix from the detector responses. The pretrained XGLM checkpoint, which has 1.7 billion parameters, stays fixed throughout the analysis.

Using the top-10 detectors per prefix, the authors find that each language draws on a growing range of detectors between layers 1 and 4 and a shrinking range between layers 19 and 24. The count of detectors that reach the leading group in both languages also rises near the input and falls near the output. Czech has a clear dip in its exclusive detector count in layers 8-15. The English-exclusive count shows a different profile, and English prefixes generally bring more distinct detectors into the leading group. Expanding the list to the top-100 weakens the visible pattern in the per-language counts. The authors observe that this broader list repeatedly includes units with very small responses.

Taken together, the counts and the language classification results led the authors to identify the regions near the input and output as more language-specific than the middle. The authors suggest that the imbalance in pretraining exposure may help explain why English recruits a wider range of detectors. They also propose that shared activity in the interior of the network may contribute to processing meaning. The latter explanation remains a hypothesis. The tests measure which detectors respond and how much information those responses carry about language identity. Which linguistic cues drive individual detectors, and how those detectors affect the generated text, remain open questions.

## Deep dive: Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks

A study of which feed-forward neurons respond to Czech and English in XGLM, and how the balance of shared and language-specific activity changes with depth. · about 31 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

#### Sharing a network across languages

A text generator trained on several languages has to meet partly overlapping demands. It must use evidence from the preceding text to anticipate what comes next, and the useful evidence can differ with the language. A translation can preserve the message while changing how words are formed, how information is ordered, or which distinctions must be expressed. This gives the paper its starting point. A network trained on multiple languages could develop some units that respond to recurring patterns across languages and others that respond chiefly to patterns encountered in a particular language. The question is where that division becomes visible as a piece of text passes through the network.

Bhattacharya and Bojar study an autoregressive system. Its training objective is to predict upcoming tokens from the text available so far. At a given position, the network works from a prefix of a sentence, building a representation that can support a prediction for the next position. Thus the same broad task applies to Czech and English, while each prediction still has to fit the context as written in its own language. The authors use that combination of shared task and differing expression to ask how feed-forward units participate in multilingual processing.

Layer depth gives the question a second dimension. The earliest transformations are close to the input representation. Later transformations operate on representations that the preceding layers have already modified, and the last layers are close to the point where the next-token distribution is read out. A unit near the input can respond to cues that are readily present in the text. A unit farther along sees the result of more processing. The paper asks whether language identity has a similarly uneven presence across feed-forward layers and whether particular units can be associated with individual languages.

This is a question about internal organization. A single prediction would give little purchase on it. For instance, a plausible continuation in Czech says little about whether the same units would also respond strongly to the English translation. Even if both continuations are plausible, they could have been produced with very different patterns of detector activity. Looking directly at those patterns turns the connection between multilingual behavior and internal computation into a measurable question.

#### Why look inside the feed-forward network?

Each Transformer block contains an attention component and a feed-forward component. The authors note that feed-forward networks account for almost two-thirds of the parameters in the architecture they discuss. They describe these networks as an important part of the system whose internal role had received relatively little dedicated study. Earlier work by Wang and Tu investigated Transformer components more broadly. Bhattacharya and Bojar concentrate on the feed-forward computation within each block and use it as the site of their language comparison. The architecture comes from [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/).

Two studies by Geva and colleagues supply much of the conceptual framework. The first treats a feed-forward network as a collection of key–value memories. A key responds to patterns in the incoming representation. Its associated value supplies a contribution whose influence depends on the strength of the key’s response. This view gives a researcher an intermediate quantity to inspect. A feed-forward output combines many contributions, while the individual coefficients reveal how strongly the corresponding units have responded along the way. The interpretation comes from the study of [feed-forward layers as key–value memories](https://md.research.elamur.ai/free/en/papers/geva-2021-transformer-feed-forward-layers-are/).

The second study connects these contributions to the output vocabulary. Under this view, the values can support groups of candidate tokens, so the feed-forward computation can be interpreted in terms of how the network builds a prediction. Bhattacharya and Bojar use the terms *detectors* and *combinators* to distinguish the units that respond to the incoming representation from the part that turns their responses into an output contribution. The terminology emphasizes the sequence of operations. First comes a response to the representation, then an activation function scales the response, and finally the resulting signals are combined. The vocabulary interpretation draws on [Geva and colleagues’ study of how feed-forward layers build predictions](https://md.research.elamur.ai/free/en/papers/geva-2022-transformer-feed-forward-layers-build/).

The paper also cites work that makes intermediate predictions accessible for inspection. A prediction made from an intermediate representation can be read as a provisional view of the likely continuation, which subsequent layers can refine. That perspective helps explain why detector activity at different depths deserves separate examination. A detector’s contribution occurs within a succession of transformations. Its meaning for the computation depends partly on where in that succession it operates. The example the authors cite is the [Tuned Lens](https://md.research.elamur.ai/free/en/papers/belrose-2023-eliciting-latent-predictions-transformers-tuned/).

Other studies had used feed-forward activations to investigate how a text generator deals with factual associations. The connection here is the choice of internal component. Factual-association research asks how particular information can be located or manipulated inside a generator. Bhattacharya and Bojar ask how patterns of response vary with the language of the input. The unit of study is again smaller than the network as a whole, but the property under investigation is different. The paper cites [Locating and Editing Factual Associations in GPT](https://md.research.elamur.ai/free/en/papers/meng-2022-locating-editing-factual-associations-gpt/).

Work on activation sparsity provides another reason to examine individual responses. The earlier studies discussed by the authors found that an input can elicit substantial activity from a limited portion of the feed-forward units. If a small set of strong responses stands out for each input, its membership can serve as a concise description of that input’s activity. Changing the size of the selected set then tests how much the description depends on including units with weaker responses. The related work includes [MoEfication](https://md.research.elamur.ai/free/en/papers/zhang-2022-moefication-transformer-feed-forward-layers/).

#### What multilingual research had already established

The paper describes earlier work on encoder-only multilingual systems that separated aspects of a representation associated with a particular language from aspects that were more neutral across languages. Such a decomposition shows that language identity and information shared across languages can be studied within a single system. An autoregressive decoder presents a related question under a different training objective. Its internal representations are built for predicting continuations from prefixes. The authors therefore ask whether a shared and a language-specific component can also be observed through the behavior of individual feed-forward detectors during that computation.

The earlier multilingual work discussed in the paper also examines what systems acquire during pretraining and how readily capabilities carry across languages. These studies motivate a distinction between nominal support for several languages and the degree to which those languages can use shared internal resources. Research about transfer asks whether a capability learned in one language is useful in another. The detector study asks the more local question of whether the same units respond strongly when each language is processed. The paper cites work on the [limits of zero-shot language transfer](https://md.research.elamur.ai/free/en/papers/lauscher-2020-zero-hero-limitations-zero-shot/).

Prior research had also explored ways of separating parameters deliberately. The authors describe a study in which allocating parameters to language-specific modules during pretraining improved performance across languages. An architecture designed in that way provides explicit places for specialization to occur. Here the investigators start with an existing checkpoint and ask whether a distinction between shared and language-associated responses can be observed in its feed-forward layers. The distinction, if visible, comes from patterns in the checkpoint’s behavior on the selected inputs. The architectural work they cite is [Modular Transformers for multilingual pretraining](https://md.research.elamur.ai/free/en/papers/pfeiffer-2022-lifting-curse-multilinguality-pre-training/).

A final piece of motivation comes from work on how linguistic information varies with depth. The paper describes earlier Transformer research as finding shallower linguistic information more accessible in layers nearer the input and more semantic information farther along. The authors reason that shallow processing could call for cues particular to the forms and structures of a language, while processing similar meanings might draw more heavily on shared units. They formulate a hypothesis about stronger language specificity at the edges of the network. The experiment tests the distribution of language-associated responses, while the proposed connection to shallow or semantic processing is an interpretation to be assessed separately. The earlier study in this line is [BERT Rediscovers the Classical NLP Pipeline](https://md.research.elamur.ai/free/en/papers/tenney-2019-bert-rediscovers-classical-nlp-pipeline/).

The authors also mention bilingual neuroimaging as a source of analogy. They describe findings in which activity associated with different languages overlaps considerably, alongside some areas associated with language-specific processing. The analogy suggests a broad coexistence of specialization and sharing. The paper’s experiment defines those notions for feed-forward detectors through observed responses to text, using layer position and the contrast between Czech and English as its points of comparison.

### The method, step by step

#### From parallel sentences to prefix inputs

The authors use the pretrained XGLM checkpoint with 1.7 billion parameters, distributed through Hugging Face. The underlying multilingual training covered 30 languages from 16 language families. Czech and English were both among the languages encountered in pretraining. The research experiment runs inputs through this existing checkpoint and records its internal states. The only training carried out for the analysis is the fitting of the language classifier used later. The checkpoint is introduced in [Few-shot Learning with Multilingual Language Models](https://md.research.elamur.ai/free/en/papers/lin-2021-few-shot-learning-multilingual-language/).

The input sample comes from the training portion of CzEng 2.0. Each selected item supplies a Czech sentence and a corresponding English sentence. The authors restrict their selection to sentences with lengths between 20 and 50. The length criterion is reported without an explicit unit. The subsequent prefix procedure is specified in sub-words, the units the network receives from its [tokenizer](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/).

Parallel sentences give the comparison a degree of control over meaning. If the Czech sample and the English sample came from unrelated collections, a detector could appear language-associated because the groups discussed different subjects. Translation pairs reduce that kind of difference at sentence level. The two versions can still express the same content in different orders, use different forms, and divide into different sub-words. Those differences are part of the input that the study measures. The design aligns the source messages while allowing the two languages to express them in their usual forms.

The researchers then process all the beginnings of the selected sentences. They start with the first sub-word, add the next, and continue until the entire sentence has been included. For an autoregressive predictor, each of those beginnings is an available context for a next-token prediction. Looking across the series exposes activity tied to partial contexts that could disappear in a measurement taken only after reading the whole sentence.

A prefix is best understood as the evidence available at a particular point in that progression. The same sentence contributes short prefixes with relatively little context and longer prefixes that include more of the message. Neighboring prefixes share almost all of their text. The analysis uses that nesting to follow activity as context accumulates, then pools responses from the full collection for its layer-level measures. A translated pair supplies two such progressions. The paper compares the resulting detector collections by language rather than requiring a one-to-one correspondence between their individual sub-word positions.

The corpus and checkpoint may have encountered some of the same material. The paper notes that XGLM’s pretraining drew on CommonCrawl and that some CzEng material also came from CommonCrawl, alongside other web sources. The authors therefore expect some resemblance in style or domain and acknowledge the possibility of overlapping sentences. Their purpose in choosing these inputs is to inspect processing behavior on familiar kinds of text. They do not run a benchmark of prediction quality on held-out examples.

How the study measures detector activity by language The steps in order.

#### From a detector response to a selection coefficient

The feed-forward interpretation separates detection, selection, and combination. A detector first produces a response to the representation it receives. The activation function then transforms that response. Its output is the selection coefficient, which determines how strongly the detector’s associated contribution enters the feed-forward combination. The researchers use the coefficients to characterize detection. The combinators explain how those coefficients can participate in prediction, while the measurements in the study focus on the coefficients themselves.

The paper defines the coefficient for a particular detector, layer, and prefix as follows.

```
Cₚₖ(Lⱼ, dᵢ) = GeLU{dᵢ(pₖ)}
```

Here, pₖ is the prefix indexed by k. Lⱼ is the feed-forward layer indexed by j, and dᵢ is the detector indexed by i within that layer. The expression dᵢ(pₖ) is the detector’s response to the representation that reaches it when the network processes pₖ. GeLU is the activation function applied to that response, and the braces mark its argument. Cₚₖ(Lⱼ, dᵢ) denotes the resulting selection coefficient. The expression describes a measurement at a particular layer and for a particular prefix. The detector receives the layer’s internal representation of the prefix.

This distinction matters when comparing layers. An early detector sees a representation formed through relatively few transformations. A later detector sees a representation that has already passed through earlier blocks. A strong response is therefore evidence that a unit responds to something available at its location in the computation. The coefficient by itself identifies neither the relevant cue nor its linguistic category. Interpreting it requires looking at how the response behaves across inputs.

For each prefix, the authors gather the coefficients for all detectors in each layer. One can picture the data for a layer as a grid. Every row corresponds to a prefix and every column to a detector. A row shows how that prefix’s activity is distributed over the units. A column shows how the same unit responds to different prefixes. The ranking analysis primarily starts with the rows, while the language classification procedure uses the coefficient data to ask what information about language is recoverable.

The ranking orders each row from larger to smaller coefficients. The authors keep the top-10 and the top-100 as alternative definitions of the leading group for a prefix. These are ranks within the prefix and layer, so the cutoff specifies a group size rather than an absolute activation level. A detector can enter a list whenever its coefficient ranks sufficiently high relative to the other units at that point. In particular, the broader list can admit a detector with a small coefficient when enough other units have even smaller responses.

#### Pooling the leading detectors

After ranking, the researchers count distinct detector identities across prefixes. This changes the question from which detectors are prominent for one context to how wide a repertoire becomes prominent anywhere in the collection. A detector that ranks highly for many prefixes contributes one identity to the pooled set. Another that enters the leading group for a single prefix also contributes one identity. Accordingly, the analysis measures coverage by the leading groups across a sample.

The paper’s notation reuses layer indices across its equations. The set operations below use k consistently for the layer and i for the prefix. For a fixed layer and a fixed language, the first step is to define the size of the leading group for each prefix.

```
|Dᵢ| = t
```

Dᵢ is the set of detector identities selected for prefix Pᵢ, where i indexes the prefixes in the collection. The vertical bars give the cardinality, or number of distinct elements, of that set. The symbol t is the chosen group size, corresponding to the paper’s top-10 or top-100 analysis. The detectors in Dᵢ are those with the largest selection coefficients in that layer for Pᵢ.

The authors then take the union of the prefix-level sets.

```
Lₖ = D₀ ∪ D₁ ∪ … ∪ Dₙ
```

Here, k identifies the fixed layer, and Lₖ denotes its pooled set for the language under consideration. D₀ through Dₙ are the leading detector sets for the indexed prefixes P₀ through Pₙ. The index n marks the last prefix in that collection, and the ellipsis stands for the intervening sets. The union symbol ∪ includes each detector found in any of the constituent sets. Counting the elements of Lₖ gives the number of different detectors that reach the leading group for at least one prefix in the language. The authors use this count as an indication of how compactly or broadly the sampled activity is distributed.

The operation is carried out separately for Czech and English. That separation produces a pair of sets for each layer and each choice of how many top-ranked detectors to retain. These sets can then be compared by identity. The same number of detectors in two sets would leave their degree of sharing open. The comparison therefore moves from the size of each set to the question of which elements the sets have in common.

#### Measuring overlap and exclusivity

The shared set consists of the detectors that enter the leading group somewhere in the Czech collection and somewhere in the English collection.

```
Iₖ = Lₖᶜˢ ∩ Lₖᵉⁿ
```

Iₖ is the set of intersecting detector identities in layer k. Lₖᶜˢ is that layer’s pooled set for Czech, marked cs, and Lₖᵉⁿ is the corresponding pooled set for English, marked en. The symbol ∩ denotes intersection. A detector belongs to Iₖ if it appears in both pooled sets, regardless of which prefixes brought it into those sets. The count of shared detectors is the cardinality of Iₖ.

For the Czech-exclusive set, the authors take a set difference.

```
csₖ = Lₖᶜˢ ∖ Lₖᵉⁿ
```

The symbol csₖ denotes the detector identities observed exclusively in the Czech leading groups for layer k. Lₖᶜˢ is the pooled Czech set and Lₖᵉⁿ the pooled English set for that layer. The symbol ∖ means that elements of the set on the right are removed from the set on the left. A detector in csₖ has entered a leading group for at least one Czech prefix and falls outside the pooled English leading group.

The English-exclusive set reverses the order.

```
enₖ = Lₖᵉⁿ ∖ Lₖᶜˢ
```

The symbol enₖ denotes the detector identities observed exclusively in the English leading groups for layer k. Lₖᵉⁿ is the pooled English set, Lₖᶜˢ is the pooled Czech set, and ∖ again denotes set difference. Counting the elements of enₖ yields the English-exclusive total. The order of the operands determines which language’s exclusive detections are counted.

The paper refers to detectors in the intersection as multilingual and those in the differences as language-specific. Both are operational descriptions. Membership depends on the sample, on the layer, and on the rank cutoff. An exclusive detector can respond to inputs in both languages and still make the leading group only in one. A shared detector can respond to different features in the two languages. The method identifies a pattern of entry into leading groups, with the precise linguistic interpretation left open.

An example in the paper follows several Czech and English prefixes that begin with *Europol*. In layer 1, detector 2149 leads for the common initial prefix and returns as the leader for some extensions. Detector 3424 appears as a leader in the English sequence. Detectors 3942 and 200 appear as leaders in the Czech sequence. Taken together over the prefixes shown, the resulting sets share 2149, leaving the other leading detectors on their respective sides. The example makes clear how repetition within a sequence and overlap between languages contribute to different parts of the analysis.

#### Recovering language identity from the coefficients

The second procedure uses a linear classifier to ask whether a prefix’s coefficient data can support a Czech or English decision. A linear classifier assigns weights to input features and uses a weighted combination to choose a label. Here the features come from detector selection coefficients, the label is the language of the prefix, and the analysis is carried out by layer. Whereas the set calculations look at membership in leading groups, this procedure asks how informative the values of the responses are about the language label.

The paper describes training the classifier over the detectors for each layer. It presents the results as counts of detectors reaching different accuracy cutoffs. In reading the figure, each series corresponds to a minimum classification accuracy, and its plotted value at a layer is a detector count. The description gives the overall probing setup and the meaning of the plotted thresholds. It leaves the precise route from classifier fitting to individual detector counts underspecified, so the reported layer profiles support a stronger reading than any reconstruction of the individual fits would.

The two procedures can produce different pictures for understandable reasons. A detector can rank highly in both languages but give systematically different coefficients in them, leaving language information in the response levels. A detector that only occasionally makes a leading group in one language can contribute to that language’s exclusive set while providing weak evidence for classification across prefixes. The classifier and the set comparison therefore probe different aspects of the same recorded activity.

### Experiments and results

#### What the comparisons measure

The two experimental inputs are the Czech and English sides of a parallel sample from the training data of CzEng 2.0. Both are processed by the same pretrained XGLM checkpoint. The comparisons vary the language, the depth of the feed-forward layer, and the number of leading detectors retained per prefix. This holds the network and sampled sentence pairs fixed while the researchers change the view taken of the activity. The analysis has internal comparison conditions, with Czech and English serving as matched sides of the corpus and the top-10 and top-100 as alternative selection settings.

The first metric is the number of distinct detector identities selected across the prefixes in a language. The related metrics are the cardinality of the intersection and the cardinalities of the Czech and English set differences. These counts answer questions about the breadth and overlap of activity. A larger per-language count means that more distinct detectors earned a leading rank somewhere in the sample. A larger shared count means that more identities did so in each language’s collection. The language classifier adds accuracy as a different measure, with the plotted detector counts grouped by the minimum accuracy attained.

The illustrative prefix pair makes the count metric concrete. With the top-1 rule in layer 1, the Czech prefixes shown produce 3 distinct leading detectors and the English prefixes shown produce 2. Both lists include detector 2149. The chart marks the larger count for this pair. The broader corpus results use the top-10 and top-100 settings and have a different relation between the languages. The example is useful for understanding exactly how repeated leader identities are counted before considering that broader comparison.

Distinct layer 1 leaders in the illustrative CzEng 2.0 prefix pair The Czech prefixes in the example bring a wider range of detectors into the leading position.

**The numbers**

| System or setting | distinct top-ranked detectors |
| --- | --- |
| English prefixes shown | 2 |
| Czech prefixes shown (this paper) | 3 |

A higher value here means a larger observed repertoire of leaders. The metric concerns detector identities. It does not give a quality score for the continuations or an estimate of how well either language is processed. In the illustrative pair, repeated appearances of a leader convey information about stability along its own prefix sequence even though the repetitions add nothing to the unique-detector count.

#### The leading groups change with depth

The profile from the top-10 setting has a similar shape for each language near the ends of the network. Between layers 1 and 4, more distinct detectors appear among the leading responses as the layers get farther from the input. Between layers 19 and 24, the number falls as the layers approach the output. The immediate observation is about the size of the pooled set. Across the sampled prefixes, many detector identities participate in the leading groups away from the outermost layers, with a narrower range visible towards the ends.

This pattern can occur even though every prefix contributes a leading group of the same size in every layer. Fixing the number retained per prefix means the changing quantity is how much the groups reuse the same detector identities. If the same units recur across many contexts, the union stays relatively compact. If the leading groups differ more across contexts, more identities accumulate in the union. The depth profile therefore reflects how much variety appears among the dominant responses from prefix to prefix.

The paper reports that English generally brings substantially more detectors into these groups than Czech does. That finding applies to the broader prefix collections and differs from the small illustrative pair. The paper gives the training exposure for English as 803,527 million tokens and for Czech as 8,616 million tokens in XGLM pretraining. The authors suggest that the larger English exposure may be reflected in the wider English detector repertoire. The experiment associates the two observations in the checkpoint as trained. The pretraining exposures are fixed properties of that checkpoint.

The top-100 setting gives a less distinct layer profile in the per-language counts. The authors observe that widening the lists brings in many units with very small coefficients, some of which recur across prefixes. This changes what the pooled set represents. The tighter selection emphasizes units standing near the front of each ranking. The broader selection also includes units with much weaker responses, whose presence in the set can obscure a pattern driven by the strongest responses. The authors relate this result to earlier observations about sparse activation in feed-forward layers.

#### Shared and exclusive sets answer different questions

The number of detectors shared by the Czech and English pools increases near the input and decreases near the output. This resembles the profile of the individual-language totals. In the middle region, many detectors that are prominent somewhere in one language are also prominent somewhere in the other. The intersection pools across prefixes, so a detector can contribute to it even if its strongest Czech and English responses arise from different sentence pairs or from different points in a pair.

The fact that individual-language counts are larger across parts of the interior makes the overlap result worth treating with care. Bigger pools have room for more common identities. The intersection provides direct evidence about which units both sets contain. Its size on its own gives an absolute count, and the paper complements it by looking at the identities exclusive to either side. Those differences show how the parts of the individual pools that lack a counterpart in the other language vary with depth.

The Czech-exclusive set becomes smaller through the middle, with the discussion identifying layers 8-15 as the region of the dip. In this part of the network, fewer detectors make a top-10 group for Czech somewhere in the sample without also making a leading group for English somewhere. The English-exclusive set has a different trajectory. The paper reports no corresponding middle-layer decline there. This asymmetry matters because the broad claim about language specificity could otherwise be read as a uniform pattern applying independently to each language.

The results point to separate forms of sharing and specialization. The middle can contain a relatively large intersection while still retaining units that rank highly only for English. An increase in shared detector identities can coexist with a persistent English-exclusive repertoire. Similarly, the decline in Czech-exclusive identities describes how Czech activity is divided between its exclusive and overlapping sets. It says less about the average response size of those detectors, which is outside what the set cardinalities measure.

#### Language cues in the classifier

The classifier figure organizes detector counts by accuracy thresholds. For brackets below 80%, the layers nearest the input show stronger evidence for language prediction in the paper’s description. For thresholds above 70%, the authors report an increase in the last few layers. These percentages are cutoffs for the accuracy brackets in the figure. They should be read as conditions for which detectors enter a plotted group, rather than as reported accuracy scores for a complete layer or for XGLM’s output.

The resulting pattern complements the Czech-exclusive dip and the shared-set findings. Near the input, coefficient values provide evidence from which the language can be recovered. A rise at the output end for higher brackets suggests that language identity becomes more recoverable there as well. The middle-layer comparison gives the authors an empirical basis for describing the regions near the input and output as more language-specific in this experiment.

The classification figure adds information because the large English repertoire alone would be a poor substitute for language decodability. A large set implies that many different units attain a leading rank across inputs. Classification concerns whether the responses available for any given input support a language decision. If the two languages placed many of the same units in their pooled sets, their coefficient patterns could still differ in a way a linear classifier can use. Conversely, a separation between pooled sets could be driven by responses specific to a small subset of contexts. The two kinds of results are most informative when read together.

The paper’s primary findings are layer profiles and contrasts between conditions. The direction of change near the input and output, the location of the Czech-exclusive dip, and the thresholds used to describe the classification figure are reported explicitly. The individual layer values are presented graphically. The reported findings are therefore clearest as changes over depth, with the example prefix pair supplying a numerical illustration of the counting procedure.

### What the ablations show

The paper reports observational comparisons and a change in the detector-selection cutoff, with causal ablations of the network outside its experimental design.

#### How much activity belongs in the leading group?

The comparison between top-10 and top-100 changes the measurement while holding the underlying responses fixed. Each setting reads the same recorded coefficients and orders them in the same way. The only change is how far down each ranking the analysis goes before collecting detector identities. This isolates the effect of including weaker responses in the per-language union.

The tighter cutoff reveals a recognizable depth profile, while the broader cutoff obscures it. This supports a specific conclusion about the measurement. The pattern of interest is easier to observe among very highly ranked responses. Extending the group adds small coefficients that repeatedly qualify under the looser rule. An identity from a very weak response then counts towards the union in the same way as an identity from the most prominent response. The broader pool can therefore become a less selective description of which detectors are substantially involved across contexts.

The authors connect this observation to sparsity. Their reasoning is that only some units respond strongly to a given prefix, so a sufficiently broad rank cutoff will reach beyond the main contributors. The comparison is consistent with concentration of activity among relatively few units. It leaves the precise boundary between strong and weak responses open. It also distinguishes sparsity for an individual input from coverage over a sample. A small leading group per input can coexist with a large pooled repertoire when different inputs bring different units to the front.

That distinction helps interpret the middle layers. A wider pool of leading units in the interior can arise from a greater diversity of prominent detectors across contexts. The count alone provides no estimate of how many units are needed to process one prefix or how much of the feed-forward output they account for. In that sense the cutoff comparison is evidence about how the observed profile depends on selecting the strongest responses, while the authors’ broader interpretation of processing capacity remains a hypothesis.

#### Does the size of a detector pool reveal sharing?

The set comparison controls an ambiguity in the individual-language results. When Czech and English each recruit a varied collection of leading detectors, the totals give no direct inventory of the shared units. Two pools with similar cardinalities can share many identities or rather few. Comparing detector identities through the intersection resolves which units are observed in both languages under the selected rule.

The set differences add a further distinction. A large shared pool may sit alongside substantial exclusive activity. The paper’s English and Czech profiles illustrate why both directions of the difference matter. Czech-exclusive activity drops in the middle, whereas the English-exclusive curve shows a different pattern. A single comparison of the total number of dominant detectors would hide that asymmetry. Combining the intersection with the two differences shows where the evidence for sharing and specificity comes from.

The example involving *Europol* illustrates the same logic at a smaller scale. The shared leading identity stays part of both pooled sets even after other identities come to the front in later prefixes. Those later changes affect each language’s repertoire separately. Across the full corpus, this way of counting asks whether detector prominence recurs anywhere in both languages. It deliberately gives the same shared status to a unit recognized through a common initial form and to a unit recognized through quite different contexts. The strength of the method is that it can discover overlap without a position alignment. The linguistic character of that overlap remains a separate question.

#### Why the classifier changes the interpretation

The classifier gives the paper a second way of checking whether language information is concentrated at certain depths. The membership analysis discards coefficient magnitudes once each leading group has been selected. The classifier uses coefficient values to recover the prefix language, bringing those magnitudes back into the comparison. The near-input and near-output patterns thus have support from a measure that asks about decodable language identity as well as from the study of leading detector identities.

The two analyses converge at a broad level while keeping their individual details. The shared pool is larger away from the outermost layers, the Czech-exclusive pool becomes smaller in the middle, and classifier performance brackets point to language information towards the edges. The English-exclusive curve qualifies a symmetric reading of these findings. The resulting account is of depth-dependent language specificity in the observed activity, accompanied by an uneven division between the two languages.

The authors offer a possible explanation linking this division to the imbalance in pretraining and to the kinds of processing thought to occur at different depths. A system with much greater English exposure may develop a wider English detector repertoire. Shared units may then handle some of the aspects of Czech processing that also arise in English. The classification and set analyses give this account something to explain. Identifying shared semantic computations or attributing the asymmetry to the amount of training data would require measurements aimed at those particular mechanisms.

### Limitations

#### Limits the authors identify

The authors study one pretrained XGLM checkpoint. Their findings characterize the feed-forward layers of that checkpoint when processing the selected prefixes. Systems trained with other configurations or other distributions of language data may organize their detectors differently. Extending the analysis to other multilingual autoregressive systems is one of the directions the authors identify for future work.

Czech and English are the only languages contrasted in the experiment. Although the checkpoint encountered 30 languages, sharing is assessed across this pair. The two languages differ in their representation in pretraining and in their linguistic properties. A detector in the intersection has demonstrated prominent activity in both Czech and English somewhere in the sample. Its behavior on any of the other training languages remains open. Likewise, a detector classed as Czech-exclusive or English-exclusive is exclusive within the measured comparison.

The authors emphasize that the linguistic cues driving individual responses remain difficult to interpret. Ranking and classifying activations establish quantitative patterns. They leave open whether particular units respond to recurring forms, structures, topics, or some combination of features. A more qualitative examination of what repeatedly triggers selected detectors would be needed to characterize the information they capture.

The discussion also treats the connection between sparse activity and shallow processing, and between denser activity and meaning, as provisional. This distinction is central to interpreting the paper. The observed object is a distribution of detector responses, and the proposed explanation concerns the kind of processing those responses serve. The authors explicitly call for more extensive experimentation before drawing that connection firmly.

The paper acknowledges the possible overlap between the input corpus and web data used in pretraining. Its authors consider the issue less consequential for this investigation because their aim is to observe internal activity. The setup is suited to that descriptive aim. A claim about generalization to unfamiliar texts would call for a different treatment of the relationship between the input sample and training material.

#### What the experimental setup leaves open

Parallel sentences control meaning at the level of the translated item, while the actual measurements are made on prefixes. A Czech prefix and an English prefix from the same pair can contain different parts of the message. Each language may introduce a piece of information at a different point, and their tokenizers may divide the corresponding expressions differently. The corpus choice reduces a major source of topic variation. It leaves the analysis sensitive to language form, segmentation, and the amount of information available at each intermediate position.

The prefixes also share substantial context within a sentence. This matters when considering classification accuracy. An evaluation that kept all prefixes from each sentence together would test transfer to new sentence contexts differently from one that divided nearby prefixes across partitions. The paper does not specify the classifier split or give enough fitting detail to establish how this dependence was handled. The reported brackets describe the observed probing results. How reliably those results carry to independent sentences is unresolved.

A pooled count depends on how many opportunities there are for new detector identities to appear. Parallel sentence pairing controls the source messages, while the two translations can still generate different numbers of sub-word prefixes. Prefix length and recurrence can also change the probability that a detector enters a leading group. The absence of a reported sample size and a breakdown of prefix counts by language leaves the reader without a direct way to assess how much these opportunities contribute to the different pool sizes.

The cutoff comparison demonstrates another source of sensitivity. A set difference identifies a detector that makes a leading group under a particular rank rule for one language without doing so for the other. A nearby change in rank can alter membership even if the response values themselves change very little. An intersection, in turn, can be established by occurrences in unrelated prefixes. Claims about stable specialization across many contexts would require information about how often, how strongly, and under what circumstances the units respond.

The paper measures absolute intersection sizes. A larger intersection in a layer with large per-language pools can reflect broader detector coverage, stronger sharing relative to the available pool sizes, or some combination of the two. The exclusive counts make the raw intersection easier to interpret and reveal the Czech–English asymmetry. The figures still leave room for a comparison designed specifically to separate pool size from the tendency to share identities.

The relationship between pretraining exposure and the English detector repertoire is observational. The language with greater reported exposure also has the larger repertoire across the sampled inputs. Since the comparison uses a fixed checkpoint and a fixed language pair, the design cannot isolate exposure from other differences, including the forms and contexts that occur in each side of the corpus. The proposed explanation is compatible with the results. A controlled change in training exposure would be needed to estimate its contribution directly.

The measurements also concern detector responses before they are combined. A coefficient can indicate prominence in that part of the computation, while the effect on a next-token prediction depends on the associated value and further transformations. A detector’s high rank or contribution to classification does not establish that it is necessary for generating text in a language. It could be informative about the language because it tracks a surface cue, because earlier processing has made that information accessible, or because it participates in a consequential computation. The observational design leaves those possibilities open.

Taken within these limits, the finding is that the strength and distribution of language-associated feed-forward activity vary with depth for this Czech–English comparison in XGLM. This is a statement about measured internal responses. The stronger interpretations, including a general division between language-specific form processing and shared semantic processing, require evidence about what the units compute and what happens to predictions when their activity changes.

### What came after

A later citing work moves the question of cross-language sharing into factual knowledge editing. Its title identifies language-agnostic factual neurons as the units through which it approaches multilingual editing. Bhattacharya and Bojar’s study concerns which detectors respond prominently to parallel text and where language identity can be recovered from those responses. The later work’s stated subject is how internal units associated with facts can be used when an edit concerns more than one language. [Multilingual Knowledge Editing with Language-Agnostic Factual Neurons](https://md.research.elamur.ai/free/en/papers/zhang-2025-multilingual-knowledge-editing-language-agnostic/).

The connection is the possibility that some units carry information usable across languages. The kind of evidence needed depends on the task. In the detector study, shared status means that a unit enters a leading group somewhere in each language’s prefix collection. In an editing study, the relevant issue is whether the unit is tied to a fact and whether a change involving it can carry across languages. The citation links these questions. It leaves open whether the later work uses the earlier paper’s ranking procedure, identifies the same kind of unit, or obtains any particular editing outcome.

## Cite

Cite as Sunit Bhattacharya and Ondřej Bojar. 2023. Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks. Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP.

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

```bibtex
@inproceedings{bhattacharya2023unveiling,
  title = {{Unveiling Multilinguality in Transformer Models: Exploring Language Specificity in Feed-Forward Networks}},
  author = {Sunit Bhattacharya and Ondřej Bojar},
  booktitle = {Proceedings of the 6th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP},
  year = {2023},
  doi = {10.18653/v1/2023.blackboxnlp-1.9},
  url = {https://doi.org/10.18653/v1/2023.blackboxnlp-1.9}
}
```

> 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)
