How Does BERT Answer Questions? A Layer-Wise Analysis of Transformer Representations
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
Citing papers per year: 2021: 12; 2022: 13; 2023: 6; 2024: 13; 2025: 12; 2026: 7.
63 papers.
Sort:
By area:
- 2023Explainability for Large Language Models: A Surveycited by 333
- 2024LLaMA Pro: Progressive LLaMA with Block Expansioncited by 101
- 2022StepGame: A New Benchmark for Robust Multi-Hop Spatial Reasoning in Textscited by 68
- 2024Explainable and Interpretable Multimodal Large Language Models: A Comprehensive Surveycited by 52
- 2021Clinical Outcome Prediction from Admission Notes using Self-Supervised Knowledge Integrationcited by 44
- 2021BERTnesia: Investigating the capture and forgetting of knowledge in BERTcited by 40
- 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layerscited by 29
- 2022FedAdapter: Efficient Federated Learning for Modern NLPcited by 25
- 2024Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layerscited by 25
- 2021Hardware Acceleration of Fully Quantized BERT for Efficient Natural Language Processingcited by 22
- 2021Contrastive Domain Adaptation for Question Answering using Limited Text Corporacited by 20
- 2024Examining Forgetting in Continual Pre-training of Aligned Large Language Modelscited by 18
38 more
- 2024Towards Tracing Trustworthiness Dynamics: Revisiting Pre-training Period of Large Language Modelscited by 18
- 2021Attention-based Clinical Note Summarizationcited by 16
- 2022Federated Few-Shot Learning for Mobile NLPcited by 15
- 2024MAS-SAM: Segment Any Marine Animal with Aggregated Featurescited by 15
- 2022An Automatic and Efficient BERT Pruning for Edge AI Systemscited by 13
- 2022A context-aware knowledge transferring strategy for CTC-based ASRcited by 12
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representationscited by 11
- 2024Transformer Block Coupling and its Correlation with Generalization in LLMscited by 10
- 2025EigenTrack: Spectral Activation Feature Tracking for Hallucination and Out-of-Distribution Detection in LLMs and VLMscited by 10
- 2021Modeling Context in Answer Sentence Selection Systems on a Latency Budgetcited by 9
- 2021What's in your Head? Emergent Behaviour in Multi-Task Transformer Modelscited by 9
- 2022QRelScore: Better Evaluating Generated Questions with Deeper Understanding of Context-aware Relevancecited by 9
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2023Unifying Two-Stream Encoders with Transformers for Cross-Modal Retrievalcited by 8
- 2024C2A: Client-Customized Adaptation for Parameter-Efficient Federated Learningcited by 8
- 2022Interactive Question Answering Systems: Literature Reviewcited by 7
- 2022Domain Adaptation for Question Answering via Question Classificationcited by 7
- 2025LYNX: Learning Dynamic Exits for Confidence-Controlled Reasoningcited by 6
- 2021Morph Call: Probing Morphosyntactic Content of Multilingual Transformerscited by 5
- 2021What BERT Based Language Models Learn in Spoken Transcripts: An Empirical Studycited by 5
- 2022The Impact of Cross-Lingual Adjustment of Contextual Word Representations on Zero-Shot Transfercited by 5
- 2022Towards Practical Few-shot Federated NLPcited by 5
- 2024Theoretical Understanding of In-Context Learning in Shallow Transformers with Unstructured Datacited by 5
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?cited by 5
- 2024Probing Critical Learning Dynamics of PLMs for Hate Speech Detectioncited by 3
- 2025Harnessing RLHF for Robust Unanswerability Recognition and Trustworthy Response Generation in LLMscited by 3
- 2021Can Edge Probing Tasks Reveal Linguistic Knowledge in QA Models?cited by 2
- 2022Input-specific Attention Subnetworks for Adversarial Detectioncited by 2
- 2025Layered Insights: Generalizable Analysis of Authorial Style by Leveraging All Transformer Layerscited by 2
- 2025From Tokens to Lattices: Emergent Lattice Structures in Language Modelscited by 2
- 2025Attention Basin: Why Contextual Position Matters in Large Language Modelscited by 2
- 2026Test-Time Mixture of World Models for Embodied Agents in Dynamic Environmentscited by 2
- 2021Consistency and Coherence from Points of Contextual Similaritycited by 1
- 2024Towards Efficient Methods in Medical Question Answering using Knowledge Graph Embeddingscited by 1
- 2024Which Neurons Matter in IR? Applying Integrated Gradients-based Methods to Understand Cross-Encoderscited by 1
- 2025The Birth of Knowledge: Emergent Features across Time, Space, and Scale in Large Language Modelscited by 1
- 2025Hierarchical Alignment: Surgical Fine-Tuning via Functional Layer Specialization in Large Language Modelscited by 1
- 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)
- 2026Assessing Reliability of BERT-Based Models on Question Answering Tasks11 Aug 2026
- 2026RDP LoRA: Geometry-Driven Identification for Parameter-Efficient Adaptation in Large Language Models21 Apr 2026
- 2026LLM Safety From Within: Detecting Harmful Content with Internal Representations20 Apr 2026
- 2026Lost in the Hype: Revealing and Dissecting the Performance Degradation of Medical Multimodal Large Language Models in Image Classification9 Apr 2026
- 2026DistillLens: Symmetric Knowledge Distillation Through Logit Lens14 Feb 2026
- 2026Test-Time Mixture of World Models for Embodied Agents in Dynamic Environments30 Jan 2026
- 2026MergeRec: Model Merging for Data-Isolated Cross-Domain Sequential Recommendation5 Jan 2026
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?23 Dec 2025
- 2025LYNX: Learning Dynamic Exits for Confidence-Controlled Reasoning5 Dec 2025
- 2025Hierarchical Alignment: Surgical Fine-Tuning via Functional Layer Specialization in Large Language Models14 Oct 2025
- 2025EigenTrack: Spectral Activation Feature Tracking for Hallucination and Out-of-Distribution Detection in LLMs and VLMs19 Sep 2025
- 2025Nested-ReFT: Efficient Reinforcement Learning for Large Language Model Fine-Tuning via Off-Policy Rollouts13 Aug 2025
38 more
- 2025Attention Basin: Why Contextual Position Matters in Large Language Models7 Aug 2025
- 2025Harnessing RLHF for Robust Unanswerability Recognition and Trustworthy Response Generation in LLMs22 Jul 2025
- 2025The Birth of Knowledge: Emergent Features across Time, Space, and Scale in Large Language Models26 May 2025
- 2025From Tokens to Lattices: Emergent Lattice Structures in Language Models4 Apr 2025
- 2025AxBERT: An Interpretable Chinese Spelling Correction Method Driven by Associative Knowledge Network4 Mar 2025
- 2025Layered Insights: Generalizable Analysis of Authorial Style by Leveraging All Transformer Layers2 Mar 2025
- 2025Random Forest-of-Thoughts: Uncertainty-aware Reasoning for Computational Social Science26 Feb 2025
- 2024Explainable and Interpretable Multimodal Large Language Models: A Comprehensive Survey3 Dec 2024
- 2024C2A: Client-Customized Adaptation for Parameter-Efficient Federated Learning1 Nov 2024
- 2024Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers5 Sep 2024
- 2024Transformer Block Coupling and its Correlation with Generalization in LLMs10 Jul 2024
- 2024Which Neurons Matter in IR? Applying Integrated Gradients-based Methods to Understand Cross-Encoders27 Jun 2024
- 2024MAS-SAM: Segment Any Marine Animal with Aggregated Features24 Apr 2024
- 2024Is Modularity Transferable? A Case Study through the Lens of Knowledge Distillation27 Mar 2024
- 2024Towards Tracing Trustworthiness Dynamics: Revisiting Pre-training Period of Large Language Models29 Feb 2024
- 2024Probing Critical Learning Dynamics of PLMs for Hate Speech Detection3 Feb 2024
- 2024Theoretical Understanding of In-Context Learning in Shallow Transformers with Unstructured Data1 Feb 2024
- 2024Towards Efficient Methods in Medical Question Answering using Knowledge Graph Embeddings15 Jan 2024
- 2024Examining Forgetting in Continual Pre-training of Aligned Large Language Models6 Jan 2024
- 2024LLaMA Pro: Progressive LLaMA with Block Expansion4 Jan 2024
- 2023Explainability for Large Language Models: A Survey2 Sep 2023
- 2023Unifying Two-Stream Encoders with Transformers for Cross-Modal Retrieval8 Aug 2023
- 2023FastDoc: Domain-Specific Fast Continual Pre-training Technique using Document-Level Metadata and Taxonomy9 Jun 2023
- 2023Diagnosing Transformers: Illuminating Feature Spaces for Clinical Decision-Making27 May 2023
- 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layers2 May 2023
- 2023Block-wise Bit-Compression of Transformer-based Models16 Mar 2023
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacities20 Dec 2022
- 2022Federated Few-Shot Learning for Mobile NLP12 Dec 2022
- 2022Towards Practical Few-shot Federated NLP1 Dec 2022
- 2022A context-aware knowledge transferring strategy for CTC-based ASR12 Oct 2022
- 2022Domain Adaptation for Question Answering via Question Classification12 Sep 2022
- 2022Interactive Question Answering Systems: Literature Review4 Sep 2022
- 2022Why Do Neural Language Models Still Need Commonsense Knowledge to Handle Semantic Variations in Question Answering?1 Sep 2022
- 2022An Automatic and Efficient BERT Pruning for Edge AI Systems21 Jun 2022
- 2022FedAdapter: Efficient Federated Learning for Modern NLP20 May 2022
- 2022QRelScore: Better Evaluating Generated Questions with Deeper Understanding of Context-aware Relevance29 Apr 2022
- 2022StepGame: A New Benchmark for Robust Multi-Hop Spatial Reasoning in Texts18 Apr 2022
- 2022The Impact of Cross-Lingual Adjustment of Contextual Word Representations on Zero-Shot Transfer13 Apr 2022
50 newest of 63 All 63 (JSON)
- 2022StepGame: A New Benchmark for Robust Multi-Hop Spatial Reasoning in Textscited by 68
- 2025LYNX: Learning Dynamic Exits for Confidence-Controlled Reasoningcited by 6
- 2025Random Forest-of-Thoughts: Uncertainty-aware Reasoning for Computational Social Sciencecited by 0
- 2025Nested-ReFT: Efficient Reinforcement Learning for Large Language Model Fine-Tuning via Off-Policy Rolloutscited by 0
- 2025LYNX: Learning Dynamic Exits for Confidence-Controlled Reasoning5 Dec 2025
- 2025Nested-ReFT: Efficient Reinforcement Learning for Large Language Model Fine-Tuning via Off-Policy Rollouts13 Aug 2025
- 2025Random Forest-of-Thoughts: Uncertainty-aware Reasoning for Computational Social Science26 Feb 2025
- 2022StepGame: A New Benchmark for Robust Multi-Hop Spatial Reasoning in Texts18 Apr 2022
- 2024Examining Forgetting in Continual Pre-training of Aligned Large Language Modelscited by 18
- 2025Harnessing RLHF for Robust Unanswerability Recognition and Trustworthy Response Generation in LLMscited by 3
- 2025Hierarchical Alignment: Surgical Fine-Tuning via Functional Layer Specialization in Large Language Modelscited by 1
- 2025Hierarchical Alignment: Surgical Fine-Tuning via Functional Layer Specialization in Large Language Models14 Oct 2025
- 2025Harnessing RLHF for Robust Unanswerability Recognition and Trustworthy Response Generation in LLMs22 Jul 2025
- 2024Examining Forgetting in Continual Pre-training of Aligned Large Language Models6 Jan 2024
- 2023Explainability for Large Language Models: A Surveycited by 333
- 2024LLaMA Pro: Progressive LLaMA with Block Expansioncited by 101
- 2021Clinical Outcome Prediction from Admission Notes using Self-Supervised Knowledge Integrationcited by 44
- 2021BERTnesia: Investigating the capture and forgetting of knowledge in BERTcited by 40
- 2023The Benefits of Bad Advice: Autocontrastive Decoding across Model Layerscited by 29
- 2022FedAdapter: Efficient Federated Learning for Modern NLPcited by 25
- 2024Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layerscited by 25
- 2021Hardware Acceleration of Fully Quantized BERT for Efficient Natural Language Processingcited by 22
- 2021Contrastive Domain Adaptation for Question Answering using Limited Text Corporacited by 20
- 2024Towards Tracing Trustworthiness Dynamics: Revisiting Pre-training Period of Large Language Modelscited by 18
- 2021Attention-based Clinical Note Summarizationcited by 16
- 2022Federated Few-Shot Learning for Mobile NLPcited by 15
12 most cited of 48 All 48 (JSON)
- 2026Assessing Reliability of BERT-Based Models on Question Answering Tasks11 Aug 2026
- 2026RDP LoRA: Geometry-Driven Identification for Parameter-Efficient Adaptation in Large Language Models21 Apr 2026
- 2026MergeRec: Model Merging for Data-Isolated Cross-Domain Sequential Recommendation5 Jan 2026
- 2025Neuron-Guided Interpretation of Code LLMs: Where, Why, and How?23 Dec 2025
- 2025EigenTrack: Spectral Activation Feature Tracking for Hallucination and Out-of-Distribution Detection in LLMs and VLMs19 Sep 2025
- 2025Attention Basin: Why Contextual Position Matters in Large Language Models7 Aug 2025
- 2025From Tokens to Lattices: Emergent Lattice Structures in Language Models4 Apr 2025
- 2025AxBERT: An Interpretable Chinese Spelling Correction Method Driven by Associative Knowledge Network4 Mar 2025
- 2025Layered Insights: Generalizable Analysis of Authorial Style by Leveraging All Transformer Layers2 Mar 2025
- 2024C2A: Client-Customized Adaptation for Parameter-Efficient Federated Learning1 Nov 2024
- 2024Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers5 Sep 2024
- 2024Transformer Block Coupling and its Correlation with Generalization in LLMs10 Jul 2024
12 newest of 48 All 48 (JSON)