mlsanityData to 14 Oct 2026

How Does BERT Answer Questions? A Layer-Wise Analysis of Transformer Representations

arXiv 1909.04925 ↗First posted 11 Sep 2019cs.CL cs.IRcited by 63

Not on the map. Why?

Abstract (arXiv)

Bidirectional Encoder Representations from Transformers (BERT) reach state-of-the-art results in a variety of Natural Language Processing tasks. However, understanding of their internal functioning is still insufficient and unsatisfactory. In order to better understand BERT and other Transformer-based models, we present a layer-wise analysis of BERT's hidden states. Unlike previous research, which mainly focuses on explaining Transformer models by their attention weights, we argue that hidden states contain equally valuable information. Specifically, our analysis focuses on models fine-tuned on the task of Question Answering (QA) as an example of a complex downstream task. We inspect how QA models transform token vectors in order to find the correct answer. To this end, we apply a set of general and QA-specific probing tasks that reveal the information stored in each representation layer. Our qualitative analysis of hidden state visualizations provides additional insights into BERT's reasoning process. Our results show that the transformations within BERT go through phases that are related to traditional pipeline tasks. The system can therefore implicitly incorporate task-specific information into its token representations. Furthermore, our analysis reveals that fine-tuning has little impact on the models' semantic abilities and that prediction errors can be recognized in the vector representations of even early layers.

Key facts. Cited by 63 papers in the map (data through 14 Oct 2026). First posted on arXiv 11 Sep 2019.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2021: 12; 2022: 13; 2023: 6; 2024: 13; 2025: 12; 2026: 7.

63 papers.

Sort:

By area:

  1. 2023Explainability for Large Language Models: A Surveycited by 333
  2. 2024LLaMA Pro: Progressive LLaMA with Block Expansioncited by 101
  3. 2022StepGame: A New Benchmark for Robust Multi-Hop Spatial Reasoning in Textscited by 68
  4. 2024Explainable and Interpretable Multimodal Large Language Models: A Comprehensive Surveycited by 52
  5. 2021Clinical Outcome Prediction from Admission Notes using Self-Supervised Knowledge Integrationcited by 44
  6. 2021BERTnesia: Investigating the capture and forgetting of knowledge in BERTcited by 40
  7. 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layerscited by 29
  8. 2022FedAdapter: Efficient Federated Learning for Modern NLPcited by 25
  9. 2024Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layerscited by 25
  10. 2021Hardware Acceleration of Fully Quantized BERT for Efficient Natural Language Processingcited by 22
  11. 2021Contrastive Domain Adaptation for Question Answering using Limited Text Corporacited by 20
  12. 2024Examining Forgetting in Continual Pre-training of Aligned Large Language Modelscited by 18
38 more
  1. 2024Towards Tracing Trustworthiness Dynamics: Revisiting Pre-training Period of Large Language Modelscited by 18
  2. 2021Attention-based Clinical Note Summarizationcited by 16
  3. 2022Federated Few-Shot Learning for Mobile NLPcited by 15
  4. 2024MAS-SAM: Segment Any Marine Animal with Aggregated Featurescited by 15
  5. 2022An Automatic and Efficient BERT Pruning for Edge AI Systemscited by 13
  6. 2022A context-aware knowledge transferring strategy for CTC-based ASRcited by 12
  7. 2026LLM Safety From Within: Detecting Harmful Content with Internal Representationscited by 11
  8. 2024Transformer Block Coupling and its Correlation with Generalization in LLMscited by 10
  9. 2025EigenTrack: Spectral Activation Feature Tracking for Hallucination and Out-of-Distribution Detection in LLMs and VLMscited by 10
  10. 2021Modeling Context in Answer Sentence Selection Systems on a Latency Budgetcited by 9
  11. 2021What's in your Head? Emergent Behaviour in Multi-Task Transformer Modelscited by 9
  12. 2022QRelScore: Better Evaluating Generated Questions with Deeper Understanding of Context-aware Relevancecited by 9
  13. 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
  14. 2023Unifying Two-Stream Encoders with Transformers for Cross-Modal Retrievalcited by 8
  15. 2024C2A: Client-Customized Adaptation for Parameter-Efficient Federated Learningcited by 8
  16. 2022Interactive Question Answering Systems: Literature Reviewcited by 7
  17. 2022Domain Adaptation for Question Answering via Question Classificationcited by 7
  18. 2025LYNX: Learning Dynamic Exits for Confidence-Controlled Reasoningcited by 6
  19. 2021Morph Call: Probing Morphosyntactic Content of Multilingual Transformerscited by 5
  20. 2021What BERT Based Language Models Learn in Spoken Transcripts: An Empirical Studycited by 5
  21. 2022The Impact of Cross-Lingual Adjustment of Contextual Word Representations on Zero-Shot Transfercited by 5
  22. 2022Towards Practical Few-shot Federated NLPcited by 5
  23. 2024Theoretical Understanding of In-Context Learning in Shallow Transformers with Unstructured Datacited by 5
  24. 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?cited by 5
  25. 2024Probing Critical Learning Dynamics of PLMs for Hate Speech Detectioncited by 3
  26. 2025Harnessing RLHF for Robust Unanswerability Recognition and Trustworthy Response Generation in LLMscited by 3
  27. 2021Can Edge Probing Tasks Reveal Linguistic Knowledge in QA Models?cited by 2
  28. 2022Input-specific Attention Subnetworks for Adversarial Detectioncited by 2
  29. 2025Layered Insights: Generalizable Analysis of Authorial Style by Leveraging All Transformer Layerscited by 2
  30. 2025From Tokens to Lattices: Emergent Lattice Structures in Language Modelscited by 2
  31. 2025Attention Basin: Why Contextual Position Matters in Large Language Modelscited by 2
  32. 2026Test-Time Mixture of World Models for Embodied Agents in Dynamic Environmentscited by 2
  33. 2021Consistency and Coherence from Points of Contextual Similaritycited by 1
  34. 2024Towards Efficient Methods in Medical Question Answering using Knowledge Graph Embeddingscited by 1
  35. 2024Which Neurons Matter in IR? Applying Integrated Gradients-based Methods to Understand Cross-Encoderscited by 1
  36. 2025The Birth of Knowledge: Emergent Features across Time, Space, and Scale in Large Language Modelscited by 1
  37. 2025Hierarchical Alignment: Surgical Fine-Tuning via Functional Layer Specialization in Large Language Modelscited by 1
  38. 2026Lost in the Hype: Revealing and Dissecting the Performance Degradation of Medical Multimodal Large Language Models in Image Classificationcited by 1

50 most cited of 63 All 63 (JSON)