scieee AI-readable full text Open interactive document viewer

SurpriseLSTM: Neural Modeling of Musical Expectation and Surprise in Monophonic Melodies

Lissenko, Tanguy

Abstract

We introduce SurpriseLSTM, an LSTM network that predicts note-by-note surprisal in strictly monophonic, symbolic melodies. We conduct the first systematic comparisonsof a neural expectancy model against the symbolic IDyOM model and the audio-based AudioIC algorithm across five complementary validation paradigms: large-scale correlations on Western melody corpora, two-note pleasantness ratings, Bach-chorale surprise profiles, and the musicalWundt effect. SurpriseLSTM matches or exceeds the performance of IDyOM in aligning with human surprise judgments. A detailed context analysis reveals distinct differences in how neural and statistical models respond to authentic cadences versus non-cadential situations, with SurpriseLSTM showing superior containment rates and distribution fitting in predicting human scale degree expectations. These findings demonstrate that recurrent neural networks, trained on basic note-level features, can accurately capture the cognitive principles of statistical learning and probabilistic prediction in music perception. Code and a pre-trained model are available at https://github.com/lissenko/surprise-lstm.

Full text

Master in Sound and Music Computing Universitat Pompeu Fabra SurpriseLSTM: Neural Modeling of Musical Expectation and Surprise in Monophonic Melodies Tanguy Lissenko Supervisors: Martin Rocamora, Manuel Anglada-Tort August 2025 Contents 1 Introduction 1 1.1 Motivation.................................. 1 1.2 Background and context . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Problemstatement............................. 2 1.4 Researchobjectives............................. 3 1.5 Methodological overview . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.6 Contributions................................ 4 1.7 ThesisOrganization ............................ 5 2 State of the Art 7 2.1 Musical Expectation, Surprise, and Uncertainty . . . . . . . . . . . . . 7 2.2 Musical Style as Probabilistic Grammar . . . . . . . . . . . . . . . . . 8 2.3 Rule-Based Expectation: Implication-Realization . . . . . . . . . . . . 8 2.4 Probabilistic Rule-Based Approaches . . . . . . . . . . . . . . . . . . . 9 2.5 IDyOM: Information Dynamics of Music . . . . . . . . . . . . . . . . . 10 2.5.1 Variable-order PPM∗inference....................... 10 2.5.2 Multiple Viewpoint Integration . . . . . . . . . . . . . . . . . . . . . . 10 2.5.3 Short-term and Long-term Memory . . . . . . . . . . . . . . . . . . . . 11 2.6 Deep Learning Approaches . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.6.1 Information-Content Curve Matching (IIC) . . . . . . . . . . . . . . . . 11 2.6.2 AudioIC: Surprisal from Audio . . . . . . . . . . . . . . . . . . . . . . 13 2.6.3 Diffusion-Based Surprisal Estimation . . . . . . . . . . . . . . . . . . . 14 3 Dataset, Preprocessing, and Feature Representation 16 3.1 Monophonic MIDI Corpora . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2 Preprocessing of MIDI Stimuli . . . . . . . . . . . . . . . . . . . . . . . 19 3.3 Feature Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4 Model Architecture and Training 23 4.1 Why Next-Pitch Prediction . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2 Desired Model Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.3 Architectural Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.4 Data Input, Masking, and Packing . . . . . . . . . . . . . . . . . . . . 24 4.5 SurpriseLSTM Architecture . . . . . . . . . . . . . . . . . . . . . . . . 25 4.6 Training Objective and Loss . . . . . . . . . . . . . . . . . . . . . . . . 25 5 Experimental Validation 28 5.1 Experimental Methodology . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.2 Experiment 1: Incremental Feature Selection . . . . . . . . . . . . . . . 29 5.3 Experiment 2: Model-Model Correlations . . . . . . . . . . . . . . . . . 32 5.4 Experiment 3: Surprise vs. Pleasantness . . . . . . . . . . . . . . . . . 33 5.5 Experiment 4: Chorale Entropy Profiles . . . . . . . . . . . . . . . . . 35 5.6 Experiment 5: Wundt-Effect Modeling . . . . . . . . . . . . . . . . . . 37 5.7 Summary and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 39 6 Neural vs. Statistical Musical Expectation 41 6.1 ChapterOverview ............................. 41 6.2 Data and Experimental Design . . . . . . . . . . . . . . . . . . . . . . 42 6.3 StatisticalAnalysis............................. 42 6.4 ResultsandAnalysis............................ 43 6.4.1 Training Data Dependencies . . . . . . . . . . . . . . . . . . . . . . . . 43 6.4.2 Cadential Context Analysis . . . . . . . . . . . . . . . . . . . . . . . . 45 6.4.3 Architectural and Cognitive Implications . . . . . . . . . . . . . . . . . 47 6.5 Discussion.................................. 47 7 Discussion and Future Work 51 7.1 Summary of Contributions . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.2 Implications for Musical Cognition . . . . . . . . . . . . . . . . . . . . 52 7.3 Extensions to Polyphonic and Audio Domains . . . . . . . . . . . . . . 53 7.4 Cross-Cultural and Individual Differences . . . . . . . . . . . . . . . . . 53 7.5 Conclusion.................................. 53 List of Figures 55 List of Tables 56 Bibliography 57 Abstract We introduce SurpriseLSTM, an LSTM network that predicts note-by-note surprisal in strictly monophonic, symbolic melodies. We conduct the first systematic comparisons of a neural expectancy model against the symbolic IDyOM model and the audio-based AudioIC algorithm across five complementary validation paradigms: large-scale correlations on Western melody corpora, two-note pleasantness ratings, Bach-chorale surprise profiles, and the musical Wundt effect. SurpriseLSTM matches or exceeds the performance of IDyOM in aligning with human surprise judgments. A detailed context analysis reveals distinct differences in how neural and statistical models respond to authentic cadences versus non-cadential situations, with SurpriseLSTM showing superior containment rates and distribution fitting in predicting human scale degree expectations. These findings demonstrate that recurrent neural networks, trained on basic note-level features, can accurately capture the cognitive principles of statistical learning and probabilistic prediction in music perception. Code and a pre-trained model are available at https://github.com/ lissenko/surprise-lstm. Keywords: Musical surprise; Information content; LSTM; IDyOM Chapter 1 Introduction 1.1 Motivation Music has the ability to create expectations in listeners and then eventually surprise by violating those expectations. When we hear the opening notes of a familiar melody, we unconsciously anticipate what comes next. Sometimes our predictions are confirmed, creating a sense of satisfaction. Other times, the music takes an unexpected turn. We might encounter a surprising chord change, an unusual melodic leap, or an unexpected rhythm, creating moments of tension, excitement, or delight. Take Beethoven’s Fifth Symphony: the opening da-da-da-DUM motif creates a clear pattern that listeners learn quickly. When this pattern returns later, sometimes unchanged and sometimes varied, it confirms or surprises our expectations. In jazz standards like Autumn Leaves, musicians first play the melody as written, setting up what listeners expect to hear. Then they improvise variations that change the melody while keeping the basic chord structure. This interplay between expectation and surprise plays important part of our musical aesthetic experience [1]. It contributes to our emotional response, and our engagement with the music. Moreover if a piece is entirely predictable, it may feel boring and if the piece is completely unpredictable, it may feel chaotic and unpleasant. The music we like often has a balance between expectations violation and confirmation. 1 2Chapter 1. Introduction Understanding how these expectations form and how surprise affects our musical experience is therefore crucial for several reasons. First, it reveals fundamental aspects of human cognition: how we learn patterns, make predictions, and adapt to new information in real time. Second, it helps explain why certain musical structures are found across cultures and historical periods, suggesting the psychological principles that govern musical aesthetics. Third, as artificial intelligence systems increasingly generate music, the ability to model and control musical surprise becomes essential for creating compositions that feel both coherent and engaging to human listeners. 1.2 Background and context The scientific study of musical expectation has evolved through several phases. In the 1950s, music theorist Leonard Meyer proposed that musical meaning emerges from the creation and resolution of expectations: when music confirms what we anticipate, we feel satisfaction; when it violates our predictions, we experience tension or surprise [2]. Building on this foundation, researchers developed rule-based theories to explain how these expectations form, drawing on principles from music theory and perceptual psychology [3, 4, 5, 1]. Since the 1990s, however, a different approach has emerged based on implicit statistical learning. This theory proposes that listeners unconsciously absorb the statistical regularities of musical styles through mere exposure, gradually building internal models that allow them to predict likely melodic and harmonic continuations [6, 7, 8]. This learning process operates automatically, without conscious effort or formal musical training, and follows similar principles observed in language acquisition and other cognitive domains [9, 10, 11]. 1.3 Problem statement Recent decades have seen the development of computational models that attempt to capture these processes. The most prominent is IDyOM (Information Dynamics of Music), which uses statistical techniques to predict the next note in a melody and quantifies surprise as the information content of unexpected events. Such models have successfully predicted aspects of human musical perception and have found 1.4. Research objectives 3 applications in music analysis, composition, and even neuroscience research [7, 8, 12, 13, 14, 15]. However, computational modeling has evolved with the rise of deep learning. Neural networks have demonstrated important abilities to learn complex patterns in sequential data, from natural language [16, 17, 18] to music [19, 20]. This raises fundamental questions: Can modern neural architectures capture the same principles of musical expectation that govern human cognition? How do their predictions compare to established statistical models? And perhaps most importantly, do they align with human judgments of musical surprise? This thesis addresses these questions by focusing on the case of monophonic melodies: single lines of music without harmonic accompaniment. While simpler than full musical textures, monophonic melodies contain the essential ingredients of musical expectation: patterns of pitch and rhythm that create predictable structures and opportunities for surprise. 1.4 Research objectives To address these gaps, we pursue three interrelated goals: 1. Neural instantiation of SLH and PPH: Develop SurpriseLSTM, a recurrent network that instantiate the statistical learning and probabilistic prediction hypothesis and learns transition statistics and outputs pitch-prediction distributions suitable for information-content computation. 2. Model-to-model comparison: We conduct a systematic evaluation of SurpriseLSTM against two benchmarks: IDyOM and the audio-based AudioIC model. We use four complementary paradigms: large-scale correlations on monophonic Western melodies, two-note interval pleasantness ratings, surprise profile fits on Bach chorales, and a replication of the musical Wundt effect. 3. Musical context analysis: Investigate how SurpriseLSTM and IDyOM respond differently to authentic cadences versus non-cadence contexts. By com- 4Chapter 1. Introduction paring scale degree distributions. We identify where neural and statistical approaches diverge in their understanding of tonal expectations. 1.5 Methodological overview Our approach involves three main components: developing a neural network model of musical surprise, comparing it with existing models, and testing all models against human data. We create SurpriseLSTM, a neural network that learns to predict the next note in a melody. The model uses basic musical information from each note (pitch, timing, melodic intervals, etc) and learns patterns from large collections of melodies. We compare this neural approach with two existing models: IDyOM (a statistical model) and AudioIC (which works with audio recordings). To evaluate how well these models capture human musical expectations, we conduct five different tests: •Finding the most important musical features for predicting surprise •Comparing model predictions across large collections of Western melodies •Testing whether models match human ratings of how pleasant different musical intervals sound •Examining detailed surprise patterns in two Bach chorales that have human annotations •Testing the Wundt effect, the idea that moderately surprising music is most pleasant 1.6 Contributions 1. We introduce SurpriseLSTM, a neural network model that applies statistical learning and probabilistic prediction principles to melodic expectation, 2.6. Deep Learning Approaches 11 where H(Pv)=−PePv(e) log2Pv(e)and Hmax(v) = log2|Ev|is the maximum entropy over viewpoint v’s alphabet Ev. 2.5.3 Short-term and Long-term Memory To reflect both lifelong enculturation and piece-specific context, IDyOM maintains long-term model (LTM) trained on a large corpus of melodies, and short-term model (STM) built dynamically on the current piece. Their predictions are interpolated, again by entropy weighting, to return the final P(e|c). 2.6 Deep Learning Approaches 2.6.1 Information-Content Curve Matching (IIC) Bjare et al. [25] propose a method for steering symbolic music generation by matching an Instantaneous Information Content (IIC) curve to a user-specified target. Given any autoregressive critic model p, they compute each token’s surprisal IC(xi|x<i) = −log p(xi|x<i) and then project these discrete IC values onto real time via a temporal-localization function f(i, x)and a smooth window λ, yielding the continuous IIC curve IIC(t, x) = X f(i,x)<t λt−f(i, x), iIC(xi|x<i). To guide generation, they define the L1deviation between the generated IIC and a target curve IIC∗(t),  IIC −IIC∗ 1=ZT 0IIC(t)−IIC∗(t, x)dt , and employ beam search over continuations, selecting at each step the candidate whose IIC best matches the target. In their experiments, they instantiate pas a causal Transformer PIA model [26] 12 Chapter 2. State of the Art Figure 1: High-level architecture of IDyOM. Multiple viewpoint streams feed PPM∗ engines in both long-term and short-term modules. Their weighted outputs combine to produce the final conditional distribution. [24] 2.6. Deep Learning Approaches 13 built on the Perceiver IO architecture, pretrained on a large corpus of expressive piano performances. MIDI events are tokenized into Pitch, Velocity, Duration, and Timeshift tokens; the Transformer predicts the next token’s distribution at each step, yielding the conditional probabilities used for IC. They demonstrate that (1) IIC correlates strongly with harmonic and rhythmic complexity, (2) listener studies can reliably identify which target IIC curve was used, and (3) matching IIC enables control of surprisal in symbolic music generation. Importantly, the underlying PIA model is not publicly released, and key implementation details are not sufficiently documented for independent reimplementation. As a result, while the IIC framework itself is general, we cannot directly reproduce or compare its performance with our SurpriseLSTM in open-source settings. 2.6.2 AudioIC: Surprisal from Audio Bjare et al. [27] extend surprisal estimation to raw music recordings by training a 12-layer causal Transformer to autoregressively predict 64-dimensional latent audio frames obtained from the Music2Latent [28] consistency autoencoder [29]. Instead of a softmax over a discrete vocabulary, they model the next-frame distribution as a 32-component Gaussian mixture whose parameters (means, variances, weights) are produced by the Transformer’s final linear layer. The frame-wise information content IC(xt|x<t)=−log pGMMxt|x<t is thus unbounded and reflects surprise over continuous audio representations. They train on a large multi-stem popular-music corpus, fine-tuning on vocal stems when modeling EEG responses. Positional context is captured via rotary embeddings and FlashAttention. Audio is preprocessed into mono MP3 at 22050 Hz, encoded by Music2Latent at approximately 11 Hz frame rate, and concatenated into sequences up to 4600 frames (about 7 min). In evaluation, AudioIC’s mean IC decreases reliably on repeated segments and rises on contrasting segments later in a piece. Moreover, including AudioIC estimates in 14 Chapter 2. State of the Art a cortical-tracking regression significantly improves EEG prediction over an energyonly baseline, demonstrating that AudioIC captures neural surprisal signatures. The authors provide an open-source implementation and pretrained weights, enabling reproduction of key results. 2.6.3 Diffusion-Based Surprisal Estimation Two distinct approaches have emerged for estimating musical surprisal using diffusion models, each addressing different aspects of temporal musical prediction. Masclef and Keller [30] propose using a denoising diffusion probabilistic model (DDPM) as a deep generative measure of musical expectation. They treat a diffusion model’s variational bound on data likelihood as an approximate surprisal: −log pθ(x0)≤LT |{z} ≈0 + T X t=1 Lt−1−L0, where each Ltis expressed in closed form via the model’s predicted noise ˆεθ(xt, t). They apply a pretrained audio-diffusion-256 model trained on mel-spectrograms, computing total surprisal by summing likelihood bounds across non-overlapping 5second blocks. Using the Gold et al. corpus, they demonstrate that diffusion-based surprisal exhibits the expected Wundt effect with significant quadratic relationships between information content and listener preference. On the other hand, Bjare et al. [31] extend surprisal estimation to causal, autoregressive scenarios using autoregressive diffusion models (ADMs). Unlike approaches that assume Gaussian mixture distributions for next-step predictions, their method estimates information content through the instantaneous change of variables formula applied to probability flow ODEs. They employ two diffusion processes: EDM and Rectified Flow, to estimate surprisal in the Music2Latent continuous audio representation space. An important insight from their work is that diffusion models can compute likelihood estimates at different noise levels during the denoising process, potentially 2.6. Deep Learning Approaches 15 capturing musical features at varying temporal and spectral granularities. They demonstrate that intermediate noise levels better correlate with symbolic pitch surprisal (as measured by IDyOM) than fully denoised representations, suggesting that controlled noise filtering preserves pitch-related expectation while removing timbral variations irrelevant to melodic surprise. Chapter 3 Dataset, Preprocessing, and Feature Representation This chapter surveys the monophonic MIDI corpora employed in our study, details the preprocessing steps applied to each collection, and outlines the full set of melodic features, along with their domains and encoding schemes, used by our LSTM model. 3.1 Monophonic MIDI Corpora Table 1 lists the MIDI datasets we used, each serving a different role (training, validation or testing). Although all collections are meant to be monophonic, a few files may contain overlapping notes; these are removed during our preprocessing step. We will explain how and when we use each set in Chapters 4 and 5. Each dataset is labeled with an integer ID, which will be used for all subsequent references. The Clean Melodies collection [32] is a hand-picked subset of the larger Los Angeles MIDI dataset. From that master corpus, which itself merges the Lakh midi dataset [33], the MetaMIDI Dataset [34], Reddit MIDI and other public scrapes, it uses only the files containing a single, strictly monophonic melody track or channel. Each melody was extracted directly from its MIDI file (no audio source), and no further transformations or post-processing were applied beyond the monophony filter. This 16 3.1. Monophonic MIDI Corpora 17 Table 1: Overview of Datasets ID Description Melodies Events E/M Pitches 1 Clean melodies (Tegridy-MIDIDataset) 117659 7530176 64.0 79 2 Western melodies 1110 50936 45.9 37 Chorale melodies 338 16912 50.0 24 German folk songs 213 8393 39.4 27 Canadian folk ballads 152 8552 56.3 26 Yugoslavian folk songs 119 2691 22.6 25 Austrian folk songs 104 5306 51.0 35 Swiss folk songs 93 4586 49.3 34 Alsatian folk songs 91 4496 49.4 32 3 Naturalistic stimuli 57 4590 80.5 48 4 Interval pleasantness 31 62 2.0 31 5 Manzara experiment stimuli 2 86 43.0 12 6 AC/NC stimuli 90 754 8.4 28 18 Chapter 3. Dataset, Preprocessing, and Feature Representation clean subset provides a compact, high-quality set of MIDI melodies for initial model development and feature testing. The Western melodies corpus combines several public-domain collections originally distributed in **kern format by the Music Cognition Laboratory at Ohio State University (see https://kern.humdrum.org/cgi-bin/browse?l=essen/europa) and the Centre for Computer Assisted Research in the Humanities at Stanford University (see https://kern.ccarh.org/cgi-bin/ksbrowse?s=nova). It was assembled to capture the broad Occidental melodic tradition, spanning repertoires from Europe and a small selection from North America. The Naturalistic Stimuli corpus [35] was developed to probe listeners’ aesthetic responses by presenting excerpts drawn from a broad array of musical genres, periods, composers, tonalities, and meters. Participants heard each excerpt and provided ratings of perceived pleasantness/liking. The interval pleasantness corpus is derived from a dense rating experiment by Anglada-Tort et al. [36], in which 415 U.S. participants rated the pleasantness of pitch intervals, derived from 15,000 stimuli sampled randomly and uniformly from −15 to +15 semitones. They used a pleasantness scale (1 = not at all pleasant to 7 = very much pleasant). We retained only integer-valued semitone intervals, i.e. those whose size is an exact whole number of semitones (no fractional values). We then generated 31 two-note MIDI files, each beginning on the reference pitch C4 and spanning all integer semitone intervals from –15 to +15. The Manzara corpus [37] comprises two monophonic lines extracted from J.S.Bach chorales (see Figure 3). In the original behavioral study, participants were asked to place monetary wagers on the identity of each upcoming pitch. From their trial-bytrial wagering accuracy, the information content (IC) of each note was estimated, yielding entropy profiles for the melodies. Further details of the entropy computation and our analyses are presented in Chapter 5. The AC/NC stimuli corpus is derived from the melodic cloze experiment by Morgan et al. [38], in which participants heard monophonic melodic openings and were 3.2. Preprocessing of MIDI Stimuli 19 asked to sing the note they expected to come next. The corpus comprises 45 pairs of melodic stems, where each pair consists of an Authentic Cadence (AC) version and a Non-Cadence (NC) version that differ by only a small number of notes. AC condition melodies end with an implied V harmony (dominant chord) that creates a strong expectation for resolution to the tonic (scale degree 1), while NC condition melodies do not end on a V harmony and were designed to avoid creating strong expectations for any particular continuation note. Although monophonic, these melodies reliably generate implicit harmonic structure for Western listeners. The corpus provides a controlled test case for examining how computational models handle cadential versus non-cadential melodic contexts, particularly their ability to recognize one of the most foundational harmonic progressions in Western music. 3.2 Preprocessing of MIDI Stimuli Before fitting any models or computing surprise metrics, every MIDI file is processed through the following pipeline. Parsing and feature extraction Each file is loaded with pretty_midi and converted into a sequence of per-note feature vectors (see Table 2). Fingerprinting and deduplication We compute a fingerprint by concatenating the pitch-duration pairs of the first ten notes of each melody. Any melody whose fingerprint matches a previously seen one is discarded. Monophony and length filtering Melodies that are not strictly monophonic (i.e. contain overlapping notes) or whose total note count falls below a datasetspecific minimum are removed. This threshold is chosen depending of the nature of the data. Shuffling The remaining melodies are randomly permuted to eliminate ordering biases during training and evaluation. 20 Chapter 3. Dataset, Preprocessing, and Feature Representation IDyOM-only subset In parallel, we assemble a secondary corpus for IDyOM evaluation by reapplying all steps above and additionally excluding any melody containing notes shorter than a sixty-fourth duration (to avoid a specific runtime error with IDyOM). 3.3 Feature Representation In order to feed each melody into the neural sequence model, every note is converted into a fixed-length vector whose components encode melodic, rhythmic, and tonal attributes. Most of the features implemented here are drawn from the cognitively motivated set used in the IDyOM model [7], which were designed to capture perceptually salient aspects of melodic structure. Causality constraint. One crucial requirement is that no feature may use information from notes that occur later than the one being encoded. Since our goal is to model human listeners’ surprise in real time, each feature for the t-th note is computed solely from the first tnotes (and any global metadata such as inferred key); the model never peeks ahead at future events it has not yet heard. This causal restriction ensures that computed surprise truly reflects what a listener could know at each moment in the unfolding melody. Table 2 summarizes the full set of features, their mathematical domains, and the form of their encoding. The most fundamental attribute is the pitch of each note, represented as an integer MIDI value in {0,...,127}and embedded via a 128-dimensional one-hot vector. To capture octave-invariant patterns, we also record pitch_class, i.e. the pitch modulo 12, similarly encoded as a 12-dimensional one-hot vector. Melodic motion is described both by the signed interval from the preceding note (an integer in {−36,...,36}) and by its contour (the sign of that interval in {−1,0,1}), each discretized into a one-hot representation. A complementary feature, cpintfip, measures the signed distance from the first note of the melody, again as a one-hot vector over the same 73-value range. 4.6. Training Objective and Loss 27 the true pitch at t+ 1. By minimizing this loss, the model learns to assign high probability to the actual continuation at every step, thereby capturing the statistical structure of melodic sequences. Chapter 5 Experimental Validation 5.1 Experimental Methodology In this chapter, we evaluate our SurpriseLSTM model of melodic surprise against two benchmarks: the statistical IDyOM model [7] and the audio-based AudioIC model [39]. We present five complementary analyses: (1) a greedy forward–backward feature-selection procedure to identify the most informative input representations; (2) a large-scale correlation study on a Western-melody corpus; (3) a two-note interval paradigm relating model-derived surprise to human pleasantness ratings; (4) detailed entropy profiles for two Bach chorales with human surprise data; and (5) a replication of the classic Wundt effect via mixed-effects modeling of surprise and liking. Ideally, one would validate a surprise model by comparing its note-by-note predictions to human listeners’ surprise judgments. However, only two Bach chorales with such annotations are available [37], which is insufficient for broad generalization. To address this, we employ the different evaluation paradigms described above to build a comprehensive assessment of model performance. 28 5.2. Experiment 1: Incremental Feature Selection 29 5.2 Experiment 1: Incremental Feature Selection To identify the subset of note-level features that best support the prediction of melodic surprise, we employed an alternating forward-backward greedy search. We begin with no features selected. In the forward pass, each candidate feature not yet in the set is added one at a time, the model is retrained, and the addition accepted as soon as it yields any improvement in performance; the pass then restarts from this enlarged set. If no single addition improves performance, we enter the backward pass: each feature in the current set is removed in turn, and any removal that boosts performance is accepted, after which we return to the forward pass. This alternating process continues until neither adding nor removing any single feature yields further gains. All evaluations use the two chorale melodies from the Manzara experiment (Dataset 5, Figure 3), with human-rated information-content profiles [37]. Each candidate feature set is used to train three independent runs of the SurpriseLSTM model on our clean melodies training corpus (Dataset 1), and tested only on these two chorales to measure generalization to unseen material. (a) BWV 379: Meinen Jesum laß ich nicht, Jesus                     (b) BWV 159: Jesu Leiden, Pein und Tod                  6           12   Figure 3: Score excerpts for the two Bach chorales used in the Manzara experiment (Dataset 5). In every run, the SurpriseLSTM consists of a stack of two LSTM layers, each with 30 Chapter 5. Experimental Validation hidden size H= 1024, followed by dropout (p= 0.5) and a final linear projection to 128 pitch logits (see Chapter 4). Models are trained for 8 epochs with batch size 128, using the Adam optimizer (learning rate 0.001), and gradients clipped to norm 5. These values were selected after exploring a range of hidden sizes, dropout rates, learning rates, and training durations: they provided the best trade-off between model capacity and generalization, yielding stable convergence across random seeds without evident overfitting. Table 3 gives metrics at each stage of the search, including Spearman’s correlation ρs, mean information content H, adjusted R2, regression slope b, and training/test losses. We performed the greedy forward–backward selection once targeting maximization of ρs. We chose Spearman’s correlation over Pearson’s as we expect monotonic rather than linear relations in the IC pairs. The inverse relationship, where mean IC Hfalls as Spearman ρsrises, aligns with theories of efficient cognitive encoding: listeners may favor features that boost the expectedness of events (raising r) while simultaneously compressing redundant information (lowering H) [40, 41]. Table 3: Incremental Feature Selection Results for SurpriseLSTM Model Features Added ρsH R2 adj bTrain Loss Test Loss pitch (baseline) 0.628 2.065 0.468 0.572 1.712 1.450 +duration 0.637 2.003 0.490 0.629 1.664 1.401 +symbolic duration 0.638 2.030 0.472 0.647 1.659 1.429 +onset 0.650 2.007 0.464 0.598 1.652 1.407 +interval 0.650 1.996 0.454 0.630 1.609 1.397 +contour 0.665 1.976 0.473 0.628 1.601 1.391 +ioi 0.667 1.987 0.469 0.606 1.597 1.396 The results in Table 3 demonstrate systematic improvements in the model’s ability to predict human surprise as successive features are incorporated. Starting with only the pitch feature as baseline, SurpriseLSTM achieves a Spearman correlation of ρs= 0.628 and adjusted R2= 0.468, with a mean entropy of 2.065 bits. Adding duration increases correlation to ρs= 0.637 and R2 adj = 0.490 while reducing mean 5.2. Experiment 1: Incremental Feature Selection 31 entropy to 2.003 bits, indicating that rhythmic information enhances both predictive accuracy and model efficiency. Incorporating symbolic duration (nearest notated value) maintains the correlation gain (ρs= 0.638) but shows a slight decrease in R2 adj to 0.472, suggesting some redundancy with the continuous duration feature. The addition of onset timing produces a more substantial improvement, boosting correlation to ρs= 0.650 while maintaining mean entropy around 2.007 bits. Adding interval information maintains this correlation level while further reducing entropy to 1.996 bits, demonstrating more efficient encoding of melodic relationships. The inclusion of contour features yields the most significant improvement in correlation (ρs= 0.665) and continues the trend of reduced mean entropy (1.976 bits), indicating that melodic shape information captures important aspects of human expectation. Finally, incorporating ioi (inter-onset interval) provides a modest additional gain to ρs= 0.667 and R2 adj = 0.469, with mean entropy stabilizing at 1.987 bits. Overall, the incremental addition of these six additional features results in modest improvements from the pitch-only baseline (∆ρs= +0.039,∆R2 adj = +0.001) while achieving more efficient representation (∆H=−0.078 bits). This suggests that pitch information alone captures much of the structure underlying human musical expectation, with additional temporal and melodic features providing incremental refinements. The consistent reduction in both training and test loss (from 1.712 to 1.597 and 1.450 to 1.396, respectively) confirms that while these supplementary features do enhance model performance, the core predictive power derives primarily from pitch relationships. The dominance of pitch information in predicting human melodic surprise requires careful interpretation. While the baseline pitch feature alone captures substantial variance, this finding encompasses not merely raw pitch values but the rich array of pitch-derived relationships that the neural model learns to encode in its distributed representations. The model weights implicitly capture complex interactions between 32 Chapter 5. Experimental Validation absolute pitch, relative intervals, scale degrees, contour patterns, and their temporal dependencies: relationships that extend far beyond simple note identification. In essence, the pitch baseline represents a compressed encoding of melodic structure that encompasses many of the derived features we explicitly tested. This dominance of pitch-related information raises intriguing questions about the universality of these findings. While pitch relationships capture the majority of variance in our Western musical context, this pattern might differ substantially in other cultural traditions where rhythmic complexity plays a more central role in musical structure and expectation. For instance, in many African, Indian, or Middle Eastern musical traditions, rhythmic patterns and their variations constitute primary sources of musical tension and resolution. A cross-cultural extension of this feature selection analysis could reveal whether the relative importance of pitch versus temporal features varies systematically across musical cultures, potentially uncovering important differences in how different societies organize musical expectation. 5.3 Experiment 2: Model-Model Correlations To situate SurpriseLSTM among existing approaches, we computed three sets of note-by-note surprise correlations on the same 1110-melody Western corpus (Dataset 2): (1) SurpriseLSTM vs. IDyOM, (2) SurpriseLSTM vs. AudioIC, and (3) IDyOM vs. AudioIC. IDyOM was retrained on our primary MIDI collection (Dataset 1) using the cpintfip viewpoint together with the linked cpintfref⊗dur-ratio combination shown by Pearce [7] to best predict pitch expectancy. SurpriseLSTM employed the feature subset selected in Experiment 1. AudioIC, which operates on continuous audio rather than symbolic sequences, was applied to WAV renders of each MIDI file (synthesized using the Upright Piano KW SoundFont available at https://freepats.zenvoid.org/Piano/acoustic-grand-piano.html). Because AudioIC’s output is a continuous time-series of surprise values, we sampled its curve at the onset times of each MIDI note to obtain discrete note-level estimates. Moreover, AudioIC incorporates timbral features since it uses audio, absent from both SurpriseLSTM and IDyOM, so some systematic differences are to be expected. 5.4. Experiment 3: Surprise vs. Pleasantness 33 For each melody, we extracted surprise time-series from all three models and computed Spearman’s rank correlation ρs, and fitted a simple linear regression to obtain the slope band the adjusted coefficient of determination R2 adj. We then averaged each metric across melodies and report the mean ±SE in Table 4. Table 4: Inter-Model Correlation Statistics Across 1,110 Western Melodies Model Pair ρs±SE b±SE R2 adj ±SE IDyOM vs SurpriseLSTM 0.639 ±0.135 0.517 ±0.187 0.411 ±0.166 AudioIC vs SurpriseLSTM 0.300 ±0.163 0.035 ±0.017 0.131 ±0.121 AudioIC vs IDyOM 0.480 ±0.151 4.704 ±1.298 0.323 ±0.150 SurpriseLSTM shows the strongest correspondence with IDyOM (ρs= 0.639±0.135, R2 adj = 0.411 ±0.166), confirming that our neural model effectively captures the conditional pitch expectations characteristic of symbolic, information-theoretic prediction. This substantial correlation suggests both models tap into similar aspects of musical structure despite their totally different computational architectures. In contrast, AudioIC exhibits weaker correlations with both symbolic models: ρs= 0.300 ±0.163 with SurpriseLSTM and ρs= 0.480 ±0.151 with IDyOM. These lower correlations likely reflect AudioIC’s design for arbitrary audio content, including polyphonic textures and timbral nuances, whereas IDyOM and SurpriseLSTM operate strictly on monophonic, symbolic representations. The moderate AudioIC– IDyOM correlation (R2 adj = 0.323±0.150) suggests some shared sensitivity to melodic patterns, though filtered through AudioIC’s distinct spectro-temporal processing. 5.4 Experiment 3: Surprise vs. Pleasantness For a direct behavioral validation of our model, we compared SurpriseLSTM’s information-content estimates against human pleasantness ratings for isolated pitch intervals (Dataset 4). These ratings were collected in a dense rating paradigm [36], in which 415 US participants judged 15 000 instances of two-note stimuli spanning the integer interval range [−15,+15] semitones. Participants provided mean pleasantness ratings on a 1 (not at all) to 7 (very much) scale. We extracted the smoothed 34 Chapter 5. Experimental Validation mean and standard error values for each integer interval. We applied the same SurpriseLSTM model (features, training data, viewpoints and hyperparameters) as in Experiment 2. For each integer interval ∆∈[−15,15], we synthesized a two-note MIDI file in which a fixed reference pitch (C5) is followed by C5+ ∆ after 0.5 s. We then predicted the information content (IC) of the second note from SurpriseLSTM, from IDyOM (using the same viewpoints and training set), and from AudioIC (after rendering each MIDI to WAV and sampling AudioIC’s continuous surprise curve at the note onset times). Finally, we computed Spearman’s correlations between model IC and human pleasantness across the 31 integer intervals. Table 5: Correlation between Model Information Content and Human Pleasantness Ratings Model Correlation (ρ) Significance SurpriseLSTM −0.821 p < .001*** IDyOM −0.802 p<.001*** AudioIC +0.240 p=.19 The correlations in Table 5 show that both SurpriseLSTM (ρ=−0.821,p<.001) and IDyOM (ρ=−0.802,p<.001) exhibit strong negative correlations with pleasantness ratings, indicating that higher model-predicted surprise corresponds to lower listener preferences. Both symbolic models capture the human tendency to find highly unexpected musical events less pleasant. AudioIC shows no reliable relationship with pleasantness ratings (ρ= +0.240, p=.19). This lack of correlation may reflect AudioIC’s focus on spectro-temporal features that do not align with the mechanisms underlying aesthetic preference in melodic contexts. These results indicate that symbolic, information-theoretic approaches to modeling melodic expectation capture the relationship between predictability and musical preference, where excessive surprise reduces listener satisfaction. The similar findings across SurpriseLSTM and IDyOM support expectation-based theories of 5.5. Experiment 4: Chorale Entropy Profiles 35 musical preference. 5.5 Experiment 4: Chorale Entropy Profiles In this analysis we examine how well each model captures the surprise trajectory in two Bach chorales from the Manzara corpus (Dataset 5). These melodies, Meinen Jesum laß ich nicht, Jesus (BWV 379) and Jesu Leiden, Pein und Tod (BWV 159), are labeled with human IC profiles obtained in a behavioral study [37]. We apply the same SurpriseLSTM and the two benchmarks, IDyOM and AudioIC, to these chorales with the same parameters as in experiments 2 and 4. Table 6 reports Spearman’s correlation ρs, mean IC, regression slope b, adjusted R2 and test loss where available. The accompanying surprise over time trajectories are shown in Figure 4. Table 6: Model Performance Metrics by Melody Melody Model ρsMean IC b R2 adj Test Loss BWV 379 SurpriseLSTM 0.698 2.070 0.635 0.541 1.435 IDyOM 0.581 2.710 0.551 0.439 N/A AudioIC 0.384 24.263 0.033 0.120 N/A BWV 159 SurpriseLSTM 0.663 2.049 0.504 0.360 1.421 IDyOM 0.534 2.471 0.510 0.306 N/A AudioIC 0.283 25.221 0.030 0.096 N/A The results in Table 6 show that SurpriseLSTM achieves the strongest alignment with human information content ratings on both chorales, with Spearman correlations of ρs= 0.698 (BWV 379) and ρs= 0.663 (BWV 159), and corresponding R2 adj values of 0.541 and 0.360 respectively. IDyOM performs comparably, with correlations of ρs= 0.581 and ρs= 0.534 for the two chorales, reflecting its effectiveness at symbolic pitch prediction. AudioIC shows weaker agreement with human ratings, achieving correlations of only ρs= 0.384 (BWV 379) and ρs= 0.283 (BWV 159). Both symbolic models demonstrate consistent performance across the two chorales, with SurpriseLSTM maintaining a slight advantage in capturing human expectation 36 Chapter 5. Experimental Validation patterns. The lower regression slopes for AudioIC (b= 0.033 and b= 0.030) indicate a weaker linear relationship with human ratings compared to the symbolic approaches. 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 0 1 2 3 4 5 6 7 8 Note Information Content Entropy Profile for Chorale BWV 379 Human LSTM 0 5 10 15 20 25 30 35 40 45 50 55 60 0 1 2 3 4 5 6 7 Note Information Content Entropy Profile for Chorale BWV 159 Human LSTM Figure 4: Comparison of human-derived Information Content (blue) and SurpriseLSTM predictions (red) for the two Manzara chorale stimuli (Dataset 5). 6.4. Results and Analysis 43 To evaluate model performance comprehensively, we compute several complementary metrics: containment rates measuring the fraction of cases where the human top choice falls within the model’s top-k predictions, Mean Reciprocal Rank (MRR) assessing the typical ranking position of human preferences in model predictions, and expected log-probability measuring how well model distributions match human response patterns. We also analyze the average of melody-level error rates, defined as half the sum of absolute differences between human and model probability distributions for each stimulus. This metric provides an intuitive measure of distribution mismatch, where values near 0 indicate perfect alignment and values near 1 indicate completely opposite distributions. 6.4 Results and Analysis 6.4.1 Training Data Dependencies The mlogit regression results reveal important insights about how the models handle large-scale, diverse training data. Table 8 shows that when IDyOM is trained on the smaller Western dataset while SurpriseLSTM uses the diverse Tegridy corpus, both models remain significant predictors of human behavior (IDyOM: coefficient = 0.429, p<2.2×10−16; LSTM: coefficient = 1.022, p < 2.2×10−16). SurpriseLSTM demonstrates a coefficient more than twice as large as IDyOM, indicating substantially stronger predictive power. Table 8: IDyOM (Western Data) + LSTM (Tegridy Data): Statistical Results AC + NC NC Predictor Est. SE z p-value Est. SE z p-value IDyOM 0.429 0.032 13.29 < 2.2e-16*** 0.253 0.040 6.31 2.77e-10*** LSTM 1.022 0.041 25.08 < 2.2e-16*** 0.771 0.055 13.89 < 2.2e-16*** Table 9 reveals a different pattern when both models are trained on the identi- 44 Chapter 6. Neural vs. Statistical Musical Expectation Table 9: IDyOM (Tegridy Data) + LSTM (Tegridy Data): Statistical Results AC + NC NC Predictor Est. SE z p-value Est. SE z p-value IDyOM -0.017 0.052 -0.32 0.749 -0.015 0.067 -0.22 0.822 LSTM 1.249 0.042 30.09 < 2.2e-16*** 0.906 0.059 15.42 < 2.2e-16*** cal large-scale Tegridy dataset. Here, IDyOM’s coefficient becomes non-significant (AC+NC: coefficient = -0.017, p= 0.749; NC only: coefficient = -0.015, p= 0.822), while SurpriseLSTM maintains strong performance (coefficient = 1.249 and coefficient = 0.906 respectively, both p < 2.2×10−16). This pattern does not indicate that IDyOM trained on Tegridy performs poorly in isolation. When evaluated alone, it achieves a significant coefficient of 0.762 (p < 2×10−16). Rather, the results suggest that SurpriseLSTM’s predictions subsume the variance explained by IDyOM when both are trained on the same diverse dataset. The neural model’s distributed representations appear to capture all the patterns that IDyOM’s explicit statistical mechanisms detect, plus additional regularities that IDyOM cannot access. This finding has important implications for understanding the relationship between neural and statistical approaches. When trained on diverse, large-scale data (conditions that better approximate real-world musical exposure) the neural model’s learned representations encompass the predictive capacity of explicit statistical modeling while extending beyond its limitations. IDyOM’s handcrafted viewpoint combinations may represent a subset of the patterns that emerge naturally from SurpriseLSTM’s end-to-end learning process. The average melody-level error analysis in Table 10 reinforces this interpretation. SurpriseLSTM achieves consistently lower error rates than IDyOM across all conditions (AC: 0.581 vs. 0.686; NC: 0.546 vs. 0.579). 6.4. Results and Analysis 45 Table 10: Average melody-level error for each model Model AC NC Tegridy LSTM 0.581 0.546 IDyOM 0.686 0.579 Western IDyOM 0.627 0.612 6.4.2 Cadential Context Analysis Figure 5 reveals systematic differences in how models handle cadential versus noncadential contexts. In AC contexts, human listeners show strong convergence on the tonic (73% of responses on scale degree 1), reflecting the powerful expectation created by implied dominant harmony. SurpriseLSTM captures this tendency with moderate concentration (30%), while IDyOM’s performance varies dramatically by training dataset: the Western-trained version achieves better tonic prediction (29%) than the Tegridy-trained version (19%). The performance metrics in Table 11 show SurpriseLSTM achieving good accuracy in cadential contexts (Note@Top-1: 57.8%) with the best distribution fit (logprobability: -5.079). Both the Western-trained IDyOM and SurpriseLSTM perform reasonably well when harmonic expectations are clear and strong. NC contexts present a more challenging test of model capabilities. Human responses become distributed across multiple scale degrees, reflecting genuine uncertainty about continuation. Here, SurpriseLSTM demonstrates superior performance across all metrics in Table 12, achieving 40% accuracy at Note@Top-1 compared to IDyOM’s 15.6% (Western) and 26.7% (Tegridy). The neural model’s distributed representations appear better suited to capturing the uncertainty that characterizes human cognition in ambiguous musical contexts. 46 Chapter 6. Neural vs. Statistical Musical Expectation Table 11: Model performance for AC (cadence) cases. Containment: fraction where the human top choice is in the model’s Top-k(Note = exact pitch, PC = pitch class). Ranking: MRR of the human top choice. Distribution fit: expected log-probability (higher is better). Category Metric LSTM (tegridy) IDyOM (western) IDyOM (tegridy) Containment Note@Top-1 0.578 0.622 0.267 PC@Top-1 0.622 0.556 0.178 Note@Top-3 0.867 0.778 0.689 PC@Top-3 0.889 0.778 0.733 Ranking Note MRR 0.740 0.724 0.518 PC MRR 0.773 0.705 0.478 Distribution fit Log-prob -5.079 -5.115 -5.254 Table 12: Model performance for NC (non-cadence) cases. Metrics as in Table 11. Category Metric LSTM (tegridy) IDyOM (western) IDyOM (tegridy) Containment Note@Top-1 0.400 0.156 0.267 PC@Top-1 0.511 0.244 0.267 Note@Top-3 0.667 0.622 0.578 PC@Top-3 0.822 0.622 0.556 Ranking Note MRR 0.546 0.416 0.466 PC MRR 0.663 0.485 0.473 Distribution fit Log-prob -5.610 -6.076 -5.467 6.5. Discussion 47 6.4.3 Architectural and Cognitive Implications Despite architectural differences, SurpriseLSTM and IDyOM show substantial correlation (ρs= 0.639 from Chapter 5), suggesting architecture-independent properties of melodic expectation. Both models demonstrate sensitivity to statistical regularities in musical sequences, whether captured through explicit n-gram modeling or learned distributed representations. However, the differential performance across training conditions and musical contexts reveals important mechanistic distinctions. SurpriseLSTM’s robustness to diverse training data and superior handling of ambiguous contexts suggests that distributed neural representations may more faithfully capture the context-sensitive nature of human musical cognition. The neural architecture’s ability to learn hierarchical features and maintain uncertainty distributions that may align better with human cognitive processes than explicit statistical tabulation. The dominance of tonic responses across both human data and model predictions indicates a bias toward tonal stability that transcends specific architectural implementations. However, this bias appears stronger in human listeners than in either computational model, suggesting that human musical cognition incorporates explicit knowledge about tonal hierarchy beyond what emerges from pure statistical learning. 6.5 Discussion These findings shows several aspects of computational approaches to musical expectation. The relationship between SurpriseLSTM and IDyOM when trained on large-scale datasets reveals not that IDyOM fails, but rather that neural models may represent a more comprehensive computational framework. When both models are trained on diverse musical data that better approximates real-world listening conditions, SurpriseLSTM’s distributed representations subsume the predictive patterns captured by IDyOM’s explicit statistical mechanisms while extending beyond their scope. 48 Chapter 6. Neural vs. Statistical Musical Expectation This subsumption suggests that handcrafted viewpoint combinations in statistical models may represent a subset of the patterns that emerge naturally from neural learning processes. Rather than indicating fundamental flaws in statistical approaches, this finding points to the possibility that neural architectures discover and integrate the same statistical regularities that inform explicit models, while simultaneously learning additional relationships that explicit programming cannot easily capture. The superior performance of SurpriseLSTM in non-cadential contexts supports this interpretation. Human musical expectation in ambiguous contexts likely involves parallel constraint satisfaction where multiple information sources contribute simultaneously to expectation formation. Distributed representations may naturally approximate this uncertainty-aware processing, whereas explicit statistical models require careful engineering to achieve similar flexibility. The architectural convergence observed between neural and statistical approaches (their substantial correlation despite fundamental differences) suggests both capture important aspects of statistical learning underlying human musical expectation. However, their divergences reveal that computational mechanisms matter significantly for modeling cognitive processes. Neural models’ ability to learn hierarchical feature representations and maintain uncertainty may align more closely with human cognitive architecture than statistical systems. These results also highlight the importance of training data diversity in evaluating cognitive models. Real-world listeners encounter enormous stylistic heterogeneity throughout their lives, and computational models must demonstrate robustness under these conditions to claim ecological validity. The finding that neural approaches better handle diverse training conditions suggests they may provide more realistic approximations of human learning processes. However, both modeling approaches leave substantial variance unexplained, particularly in complex musical contexts. This limitation indicates that complete models of musical cognition will require integration of hierarchical harmonic understand- 6.5. Discussion 49 ing, long-term structural dependencies, and cultural conditioning factors that shape individual listening strategies. The current results suggest that while neural approaches may provide a more comprehensive foundation, significant theoretical and computational advances are still needed to fully capture human musical cognition. 50 Chapter 6. Neural vs. Statistical Musical Expectation 1234567 0 0.2 0.4 0.6 0.8 1 Proportion Human 1234567 0 0.2 0.4 0.6 0.8 1 1234567 0 0.2 0.4 0.6 0.8 1 Proportion IDyOM (Western) IDyOM (Tegridy) 1234567 0 0.2 0.4 0.6 0.8 1 1234567 0 0.2 0.4 0.6 0.8 1 Scale Degree Proportion LSTM 1234567 0 0.2 0.4 0.6 0.8 1 Scale Degree Authentic Cadence Non-Cadence Figure 5: Distribution of scale degrees for Human, LSTM, and IDyOM models. Authentic Cadence (left column) and Non-Cadence (right column) are compared, with IDyOM shown in two variants (trained on Tegridy dataset and the Western dataset). Chapter 7 Discussion and Future Work 7.1 Summary of Contributions This thesis introduced SurpriseLSTM, a neural network model that applies statistical learning and probabilistic prediction principles to melodic expectation, demonstrating that recurrent architectures can effectively model musical surprise from basic note-level features. Through systematic comparison with established benchmarks across multiple evaluation paradigms, we have provided the first comprehensive assessment of neural versus statistical approaches to modeling musical expectation in the monophonic domain. Empirically, we demonstrated that SurpriseLSTM matches or exceeds IDyOM’s performance in predicting human surprise judgments across five complementary validation tasks. The model successfully captures the inverse relationship between surprise and pleasantness, reproduces the classical Wundt effect, and provides superior fits to human entropy profiles in Bach chorales. Theoretically, our findings reveal important distinctions between neural and statistical approaches. When trained on large-scale, diverse datasets that better approximate real-world musical exposure, SurpriseLSTM’s distributed representations subsume the predictive patterns captured by IDyOM’s explicit statistical mechanisms while extending beyond their scope. This suggests that neural architectures may 51 52 Chapter 7. Discussion and Future Work naturally discover and integrate the same regularities that inform statistical models, while simultaneously learning additional relationships that explicit programming cannot easily capture. 7.2 Implications for Musical Cognition Our results provide several insights into the computational principles underlying human musical expectation. The dominance of pitch-related features in driving predictive accuracy suggests that melodic contour and interval relationships constitute the primary feature of musical expectation in Western tonal music. However, this finding requires careful interpretation: the neural model’s pitch representation encompasses complex interactions between absolute pitch, relative intervals, scale degrees, and temporal dependencies that extend far beyond simple note identification. The superior performance of SurpriseLSTM in ambiguous musical contexts (particularly non-cadential passages where human expectations are distributed rather than focused) suggests that human musical cognition relies on uncertainty-aware processing mechanisms. Distributed neural representations may better approximate the parallel constraint satisfaction processes that characterize human expectation formation, where multiple information sources contribute simultaneously to probabilistic predictions. The consistent alignment between model predictions and human aesthetic judgments across multiple paradigms supports theories linking predictive processing to musical enjoyment. The replication of the Wundt effect demonstrates that computational models of surprise can capture fundamental relationships between complexity and preference, suggesting that aesthetic experience may emerge from optimal calibration of predictive mechanisms. However, our findings also highlight significant limitations in current computational approaches. Both neural and statistical models leave substantial variance in human behavior unexplained, particularly in complex musical contexts. This suggests that BIBLIOGRAPHY 59 [19] Huang, C.-Z. A. et al. Music transformer (2018). URL https://arxiv.org/ abs/1809.04281.1809.04281. [20] Roberts, A., Engel, J., Raffel, C., Hawthorne, C. & Eck, D. A hierarchical latent vector model for learning long-term structure in music (2019). URL https://arxiv.org/abs/1803.05428.1803.05428. [21] Shannon, C. E. Prediction and entropy of printed english. The Bell System Technical Journal 30, 50–64 (1951). [22] Temperley, D. A probabilistic model of melody perception. Cognitive Science 32, 418–444 (2008). URL https://onlinelibrary.wiley.com/doi/abs/10. 1080/03640210701864089.https://onlinelibrary.wiley.com/doi/pdf/ 10.1080/03640210701864089. [23] Conklin, D. & Witten, I. Multiple viewpoint systems for music prediction. J. New Music Res 24 (2003). [24] Pearce, M. T. Learning to Listen, Listening to Learn: Music Perception and the Psychology of Enculturation (Oxford University Press, Oxford, 2025). URL https://doi.org/10.1093/oso/9780198848004.001.0001. [25] Bjare, M. R., Lattner, S. & Widmer, G. Controlling surprisal in music generation via information content curve matching (2024). URL https://arxiv. org/abs/2408.06022.2408.06022. [26] Hadjeres, G. & Crestel, L. The piano inpainting application. CoRR abs/2107.05944 (2021). URL https://arxiv.org/abs/2107.05944.2107. 05944. [27] Bjare, M. R., Cantisani, G., Lattner, S. & Widmer, G. Estimating musical surprisal in audio (2025). URL https://arxiv.org/abs/2501.07474.2501. 07474. [28] Pasini, M., Lattner, S. & Fazekas, G. Music2latent: Consistency autoencoders for latent audio compression (2024). URL https://arxiv.org/abs/ 2408.06500.2408.06500. 60 BIBLIOGRAPHY [29] Song, Y., Dhariwal, P., Chen, M. & Sutskever, I. Consistency models (2023). URL https://arxiv.org/abs/2303.01469.2303.01469. [30] Masclef, N. L. & Keller, T. A. Deep generative models of music expectation (2023). URL https://arxiv.org/abs/2310.03500.2310.03500. [31] Bjare, M. R., Lattner, S. & Widmer, G. Estimating musical surprisal from audio in autoregressive diffusion model noise spaces (2025). URL https:// arxiv.org/abs/2508.05306.2508.05306. [32] Lev, A. Los angeles midi dataset: Sota kilo-scale midi dataset for mir and music ai purposes. In GitHub (2024). [33] Raffel, C. Learning-Based Methods for Comparing Sequences, with Applications to Audio-to-MIDI Alignment and Matching. Ph.D. thesis, Columbia University, USA (2016). URL https://doi.org/10.7916/D8N58MHV. [34] Ens, J. & Pasquier, P. Building the metamidi dataset: Linking symbolic and audio musical data. In Lee, J. H. et al. (eds.) Proceedings of the 22nd International Society for Music Information Retrieval Conference, ISMIR 2021, Online, November 7-12, 2021, 182–188 (2021). URL https://archives.ismir. net/ismir2021/paper/000022.pdf. [35] Gold, B. et al. Auditory and reward structures reflect the pleasure of musical expectancies during naturalistic listening. Frontiers in Neuroscience 17 (2023). [36] Anglada-Tort, M., Harrison, P. M., Lee, H. & Jacoby, N. Large-scale iterated singing experiments reveal oral transmission mechanisms underlying music evolution. Current Biology 33, 1472–1486.e12 (2023). URL https: //www.sciencedirect.com/science/article/pii/S0960982223002439. [37] Manzara, L. C., Witten, I. H. & James, M. On the entropy of music: An experiment with bach chorale melodies. Leonardo Music Journal 2, 81–88 (1992). BIBLIOGRAPHY 61 [38] Morgan, E., Fogel, A., Nair, A. & Patel, A. D. Statistical learning and gestalt-like principles predict melodic expectations. Cognition 189, 23– 34 (2019). URL https://www.sciencedirect.com/science/article/pii/ S0010027718303317. [39] Bjare, M. R., Cantisani, G., Lattner, S. & Widmer, G. Estimating musical surprisal in audio (2025). URL https://arxiv.org/abs/2501.07474.2501. 07474. [40] Chater, N. Reconciling simplicity and likelihood principles in perceptual organization. Psychological Review 103, 566–581 (1996). [41] Chater, N. The search for simplicity: A fundamental cognitive principle? The Quarterly Journal of Experimental Psychology Section A 52, 273–302 (1999). [42] Berlyne, D. E. Studies in the new experimental aesthetics: Steps toward an objective psychology of aesthetic appreciation. Journal of Aesthetics and Art Criticism 34, 86–87 (1975).