Jupyter notebook Supplementary Materials 4 - Simulation.ipynb
Supplementary Materials 4: Simulation
This notebook provides the details of the simulation study discussed in Section 3.2 of the journal article associated with this Supplementary Material, "Incremental parsing in a continuous dynamical system: Sentence processing in Gradient Symbolic Computation".
Language
To make the core computational problems clear, we consider a formal language L = {S1='A B', S2='A C', S3='D B', S4='D C'}. We characterize L by a phrase structure grammar G and convert it to an equivalent set of harmonic grammar rules (see Part 1) as follows.
We specify a set of input sentences as follows. Note that each sentence is a sequence of two terminal bindings. By a terminal binding, we mean a binding of a terminal symbol (filler) with a terminal role (span role ). It is assumed that the positoinal information is available from the linear order of the input string.
For each input sentence, we specify a target structure as follows. For now, users must provide the information. In a future version, the software will be able to generate a set of grammatical sentences and their corresponding structures.
The GSC model will build a discrete symbolic structure, which can be grammatical or ungrammatical, after processing a sentence. We classify each chosen structure into 5 classes: target (e.g., T1 for input S1), garden path error (e.g., T2 for input S1), local coherence error (e.g., T3 for input S1), other grammatical (e.g., T4 for input S1), and other ungrammatical (any structure other than T1, T2, T3, T4). For that purpose, we define a map from a pair (input_sentence, structure_chosen) to response_class as follows.
For example, if the model has built T1 (first column of the matrix ) for input S2 (second row), classify the response as 1 (= [second row][first column]), indicating a garden path error. The final column indicates that the model has built an ungrammatical structure.
Quantization (commitment) policies
In Section 2.5 of the main article, we argued the model can parse a sentence by increasing quantization strength (or commitment level) appropriately. To investigate the effect of quantization policy, we consider three different quantization policies. The value after processing the first word is manipulated in three levels (5, 25, 100). The values before and after processing a sentence are fixed to 0 and 200, respectively.
Simulation setting
In incremental processing, computational temperature is fixed to a small value. The effect of in incremental processing needs further investigation.
Create a data file and store simulation and model setting
Before running simulations, we create a data file named and store simulation and model setting parameters. When running simulation, the program will read the information to construct model instances and simulation environments. NOTE: if exists, it will be overwritten and all information contained in the file will be lost.
In the following, the program will 1,200 trials of simulations. It may take long. For your convenience, we uploaded file containing all simulation data (please do not overwrite this file). If you do not want to run simulations by yourself, you can jump to section Distributions of chosen structures to check the simulation results.
Running simulation
Run the code block below. A progress bar will appear to give you an estimate of running times. You can freely interrupt the program by pressing the stop ('interrupt kernel') button on the menu; or click 'Kernel' on the top down menu and then click 'interrupt'. Software will safely store trial data into file. You can run this block again to resume. In this case, the total number of trials displayed next to the progress bar will decrease by the number of trials you ran before.
Distributions of chosen structures
Sample activation state trajectories
The figure above presents ten (of 100) sample activation histories for input sentence S1. Only the full-string bindings for each output sentence (S[k]/(0,1,2)) are shown and labeled as Sk.
Run the model without noise
The response distributions and the sample activation state histories investigated in the above suggest that the model behaves very consistently across trials under Policy 2. In other words, under Policy 2, trial-level activation histories can be described nicely by the expected activation histories. Note that this is not always true. For example, if we average the state histories under Policy 3, we will get a very different profile from the trial-level profiles.
We investigate the expected activation state change by running the model again, this time without update noise (i.e., = 0).
The figure above (not included in the main article) presents the expected activation change in the model following Policy 2. We note that the expected activation value of S[3]/(0,1,2) is higher than the activation of S[4]/(0,1,2) when the model is processing the second word 'B' (see the black circle), although both bindings are inconsistent with context, the first word 'A'. This is because the former is consistent with the bottom-up input while the latter is not. Unlike ideal rational models, the model does not completely suppress the partial activation of locally coherent but globally incoherent structures. Similar phenomena have been observed in visual world paradigm experiments and are interpreted as the local coherence effect (Allopena, Magnuson, & Tanenhaus, 1998; Kukona, Cho, Magnuson, & Tabor, 2014).
The full activation states sampled at three time points ( = 0, 5, 10) are presented below.
For readability, we presented the activation states in a different format in the main article. Please see below.
Stability of the blend states [Not included in the main article]
The GSC model, on average, climbs up a local hump in a harmony surface but the harmony surface changes dynamically as a function of the commitment level . The activation state continues to change until it reaches a discrete symbolic state. What will happen if stays constant for a certain amount of time? During that period, the harmony surface does not change -- unless external input is updated -- so the model will move to and stay at a peak of a local hump. This suggests the GSC model can move to a blend state mixing multiple interpretations and maintain those interpretations by keeping constant.
We show this property rather informally. Let us suppose that the system is at a local optimum , a blend state where total harmony is locally maximal, at a given value of . We will perturb the system by adding small gaussian noise (SD = 0.01) and take this as the state at time 0, = + noise, and let the system update its state with constant and a of 0. We will repeat the experiment 20 times. If always approaches (equivalently, always approaches 0) as , then is called an attractor or asymptotically stable equilibrium point (Strogatz, 1994), suggesting that the system can really hold on to the multiple interpretations implied by a blend state. (Note: If the perturbation noise is too large, then, the system may be displaced to be on a different local hump so will move to another local optimum.)
Now we perturb the system from the candidate stable blend state by adding gaussian noise. Then, we let the model update its state again. As before, is fixed to the present value and is set to 0.
Now we plot the Euclidean distance between and against time .
The figure above suggests that the system has returned to the candidate stable blend state, suggesting that it is really an attractor. The result implies that the GSC model can hold temporary ambiguity as far as it keeps the commitment level constant.
References
Allopenna, Paul D., James S. Magnuson & Michael K. Tanenhaus. 1998. Tracking the time course of spoken word recognition using eye movements: Evidence for continuous mapping models. Journal of Memory and Language 38(4). 419–439. doi:10.1006/jmla.1997.2558.
Kukona, Anuenue, Pyeong Whan Cho, James S. Magnuson & Whitney Tabor. 2014. Lexical interference effects in sentence processing: Evidence from the visual world paradigm and self-organizing models. Journal of Experimental Psychology: Learning, Memory, and Cognition 40(2). 326–347. doi:10.1037/a0034903.
Strogatz, Steven H. 1994. Nonlinear dynamics and chaos: With applications to physics, biology, chemistry, and engineering. Westview Press.