First Principles of Large Language Models: A Signal Processing View of Semantic Vectorization

    This article reframes large language model input as semantic embedding vectors and explains language modeling through a signal processing lens. It covers how token embedding works as sampling and vector quantization, why high-dimensional representations improve signal-to-noise ratio, and how information theory and the information bottleneck explain compression. It then maps token sequences to discrete-time signals to clarify attention as content-adaptive filtering and positional encoding as phase information, relates attention to Granger causality while noting key differences, and closes with practical engineering recommendations.

    1. The Core Thesis: Recasting Language Modeling as an Engineering Problem

    When people discuss large language models, the usual narrative starts from linguistics and emphasizes syntactic structure, semantic roles, and logical reasoning. But if we instead treat the model input as semantic embedding vectors of tokens, the nature of the task changes: natural language processing becomes a signal processing problem. This reframing is not wordplay. It is a fundamental judgment that drives architecture choices, training objective design, and the boundaries of inference efficiency.

    As we noted in the statistical physics perspective, large models do not explicitly model grammar or logic; they characterize the distribution of language purely from a probabilistic standpoint. The problem is that doing probability modeling directly in discrete token space is computationally infeasible, because the state space grows exponentially with sequence length. Engineering has addressed this with tools such as probabilistic graphical models and message passing to reduce complexity. Modern large models take a more thorough approach: first map discrete symbols into a continuous vector space, then perform statistical modeling in that continuous space. This step is exactly what semantic vectorization is about.

    2. Semantic Vectorization: Mapping Symbols to Waveforms

    2.1 Embedding as Sampling and Quantization

    Mapping a token to a fixed-dimensional dense vector is analogous to sampling and quantization in signal processing. Natural language is continuous and infinitely rich in expression, while the vocabulary is a discrete sampling of it. The embedding matrix acts like a quantization table, assigning each discrete symbol a coordinate in a high-dimensional space. Unlike scalar quantization, this is vector quantization, which preserves the relative positions between symbols.

    This view leads to an important implication: semantic similarity is equivalent to a distance metric in vector space. Synonymy, near-synonymy, and hypernymy are encoded as geometric proximity, while analogical relationships are encoded as translation-invariant directional structure. Language phenomena thereby acquire analyzable properties resembling a waveform.

    2.2 Signal-to-Noise Ratio and Representational Redundancy

    Signal processing cares about signal-to-noise ratio. In semantic embeddings, noise corresponds to incidental collocations and labeling bias in the training corpus, while signal corresponds to stable semantic structure. The value of high-dimensional representations lies in providing enough redundancy: even if some dimensions carry noise, the overall semantics can still be recovered robustly from the remaining dimensions. This also explains why embedding dimensions cannot be too low. Insufficient dimensions are like an insufficient sampling rate; high-frequency semantic components alias, and fine-grained discrimination is lost.

    A simple illustration (showing only the relationship between dimensionality and semantic separability, not a real implementation):

    1. # Illustration: insufficient dimensions cause semantic aliasing
    2. import numpy as np
    3. def alias_demo(dim):
    4. # Construct two semantically separable groups of vectors
    5. a = np.random.randn(200, dim)
    6. b = np.random.randn(200, dim) + 0.35
    7. # Measure separability by center distance
    8. sep = np.linalg.norm(a.mean(0) - b.mean(0))
    9. return round(float(sep), 3)
    10. for d in [2, 8, 64, 512]:
    11. print(d, alias_demo(d))

    3. An Information-Theoretic View: Compression, Entropy, and the Bottleneck

    The other side of vectorization is compression. The embedding layer compresses a huge vocabulary into a finite-dimensional continuous representation, essentially searching for a high-fidelity compressed encoding of the language distribution. Information theory gives a clear constraint: the lower bound of a representation is determined by the entropy of the source distribution, and no lossless compression can go below entropy. In practice we accept lossy compression, because downstream tasks only care about the components with the largest mutual information with the prediction target.

    This leads to the information bottleneck framework: a good representation should maximize mutual information with the target while minimizing redundant information about the input itself. During training, the model discards task-irrelevant details layer by layer and retains discriminative structure. From a signal processing perspective, this is a set of adaptive filters whose passband is implicitly determined by the task distribution.

    4. The Transformer from a Time-Series Perspective

    4.1 Sequences as Discrete-Time Signals

    Once a token sequence is viewed as a discrete-time signal, language modeling becomes non-stationary sequence prediction with long-range dependencies. Recurrent structures naturally correspond to recursive filter states, but they suffer from gradient decay and limited parallelism. Attention is equivalent to a time-varying, content-adaptive filter kernel: the output at each position is a weighted sum of values at all positions, with weights generated dynamically from the similarity between queries and keys.

    Compared with a traditional convolution kernel, the key difference of attention is that the weights are not fixed but determined by the data itself. This lets the model build associations across arbitrary distances, at the cost of computation and memory growing quadratically with sequence length. Later improvements such as sparsification, linearization, and chunking can all be understood as reducing filter complexity while preserving passband characteristics.

    4.2 Positional Encoding as Phase Information

    Discrete-time signal processing must handle phase. Positional encoding injects phase information into the sequence so the model can distinguish order from reverse order. Absolute positional encoding is like a fixed phase reference, relative positional encoding is closer to phase-difference invariance, and rotary positional encoding applies position-dependent rotations to queries and keys so that the inner product depends only on relative displacement. Under the language of signal processing, this is an extremely natural construction.

    5. The Relationship with Granger Causality

    The criterion for Granger causality is that if adding lagged terms of sequence X significantly reduces the prediction error for Y, then X is said to have a Granger-causal effect on Y. It is essentially a statistical test about “predictability gain,” not a structural causal relationship.

    The Transformer formally echoes this idea: attention weights can be read as the contribution of each position to the current prediction, and if the presence of a historical position significantly changes the predictive distribution, it is similar to passing a predictability-gain test. But three differences must be distinguished rigorously:

    1. Attention weights are internal allocation coefficients of the model, not the result of a statistical significance test.
    2. Attention can attend to multiple positions simultaneously, whereas the classic Granger test assumes a linear lagged model.
    3. A large model predicts the next token distribution, so its “causal” conclusions hold only within the observed distribution; interventions and out-of-distribution extrapolation are not automatically valid.

    A more accurate statement is therefore this: attention functionally implements adaptive, nonlinear allocation of predictability gain, and shares the philosophy of Granger causality in defining dependence by predictive power, but it cannot be used directly as a causal inference tool.

    6. Engineering Recommendations

    • Prioritize representation quality: vectorization is upstream in the entire pipeline, and upstream aliasing cannot be fixed by downstream modules.
    • Control sequence length: quadratic complexity means context length must be traded off against business value.
    • Watch for distribution drift: non-stationarity can cause passband mismatch, requiring continuous evaluation and retraining.
    • Build observability: use general-purpose logging services and monitoring and alerting systems to track anomalies in the representation layer and attention distributions.
    • Schedule elastic resources: training and inference loads differ greatly, and general capabilities such as container platforms and message queues can help smooth peaks and fill valleys.

    7. Summary

    Treating large model input as semantic vectors turns the language problem into a signal processing problem. Information theory explains the necessity of compression and the bottleneck, the time-series view explains the design motivation behind attention and positional encoding, and Granger causality offers an analogy for understanding predictive dependence. Together, these three perspectives form a complete first-principles chain from symbols to continuous representations and from statistical modeling to architecture design.