paper-with-me

Papers

Codebook Features: Sparse and Discrete Interpretability for Neural Networks

2023-10-26 · Alex Tamkin, Mohammad Taufeeque, Noah D. Goodman

Understanding neural networks is challenging in part because of the dense, continuous nature of their hidden states. We explore whether we can train neural networks to have hidden states that are sparse, discrete, and more interpretable by quantizing their continuous features into what we call codebook features. Codebook features are produced by finetuning neural networks with vector quantization bottlenecks at each layer, producing a network whose hidden features are the sum of a small number of discrete vector codes chosen from a larger codebook. Surprisingly, we find that neural networks can operate under this extreme bottleneck with only modest degradation in performance. This sparse, discrete bottleneck also provides an intuitive way of controlling neural network behavior: first, find codes that activate when the desired behavior is present, then activate those same codes during generation to elicit that behavior. We validate our approach by training codebook Transformers on several different datasets. First, we explore a finite state machine dataset with far more hidden states than neurons. In this setting, our approach overcomes the superposition problem by assigning states to distinct codes, and we find that we can make the neural network behave as if it is in a different state by activating the code for that state. Second, we train Transformer language models with up to 410M parameters on two natural language datasets. We identify codes in these models representing diverse, disentangled concepts (ranging from negative emotions to months of the year) and find that we can guide the model to generate different topics by activating the appropriate codes during inference. Overall, codebook features appear to be a promising unit of analysis and control for neural networks and interpretability. Our codebase and models are open-sourced at https://github.com/taufeeque9/codebook-features.

📄 PDF Abstract BibTeX arXiv:2310.17230

Code (1)

taufeeque9/codebook-features 공식 구현 pytorch

Tasks

Quantization

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Adam 설명 없음
Position-Wise Feed-Forward Layer 설명 없음

Similar Papers 제목 키워드 기반

CIVQLLIE: Causal Intervention with Vector Quantization for Low-Light Image Enhancement

2025-08-05 · Tongshun Zhang, Pingping Liu, Zhe Zhang, Qiuzhan Zhou arxiv

Images captured in nighttime scenes suffer from severely reduced visibility, hindering effective content perception. Current low-light image enhancement (LLIE) methods face significant challenges: data-driven end-to-end …

Low-Light Image EnhancementRepresentation Learning

Style Quantization for Data-Efficient GAN Training

2025-03-31 · CVPR 2025 1 · Jian Wang, Xin Lan, Jizhe Zhou, Yuxin Tian 외

Under limited data setting, GANs often struggle to navigate and effectively exploit the input latent space. Consequently, images generated from adjacent variables in a sparse input latent space may exhibit significant di…

NavigateQuantization

Near-field Beam Training with Sparse DFT Codebook

2024-06-06 · Cong Zhou, Chenyu Wu, Changsheng You, Shuo Shi

Extremely large-scale array (XL-array) has emerged as one promising technology to improve the spectral efficiency and spatial resolution of future sixth generation (6G) wireless systems.The upsurge in the antenna number …

Grouped Discrete Representation Guides Object-Centric Learning

2024-07-01 · Rongzhen Zhao, Vivienne Wang, Juho Kannala, Joni Pajarinen

Similar to humans perceiving visual scenes as objects, Object-Centric Learning (OCL) can abstract dense images or videos into sparse object-level features. Transformer-based OCL handles complex textures well due to the d…

AttributeObject

Deep Spherical Quantization for Image Search

2019-06-07 · CVPR 2019 6 · Sepehr Eghbali, Ladan Tahvildari

Hashing methods, which encode high-dimensional images with compact discrete codes, have been widely applied to enhance large-scale image retrieval. In this paper, we put forward Deep Spherical Quantization (DSQ), a novel…

Image RetrievalQuantizationRetrieval