Full text
Constraint-Driven Coherence in LLM Output: Replication Dataset (GPT-4o) 1. Purpose The purpose of this package is to provide a reproducible baseline replication of the primary experimental finding: increasing informational constraint leads to a decrease in both mean surprisal and mean token entropy in the model's output. Primary Analysis: Demonstrates the trend of surprisal and entropy decreasing as constraint increases. Secondary Analysis (Panel C): Plots mean surprisal vs. mean entropy across all runs. This reveals a correlation consistent with dual-regime cognitive processing: fast/exploratory vs. slow/convergent. 2. How to Reproduce the Results This archive contains the necessary code and data to reproduce the figures and key statistics presented in the associated paper. This bundle is standalone; no API key is required. Use the provided CSVs. 1. Obtain the Files: Download the complete archive from Zenodo. This package should include: The notebook file (`CPA_Coherence_AI_GPT4o_Replication.ipynb`) A data folder (e.g., `zenodo_replication_data`) containing the four required data files: o `gpt4o_summary_by_run.csv` o `gpt4o_summary_by_constraint.csv` o `gpt4o_summary_entropy.csv` o `gpt4o_raw_main_data.csv.gz` o `requirements.txt` file listing the software dependencies. This README file.
2. Prepare the Data: Place the `zenodo_replication_data` folder (containing all four data files) into a directory named `CPA_Coherence_AI_Input_Data` in your Google Drive. The full path to the data folder in your Drive should be `MyDrive/CPA_Coherence_AI_Input_Data/zenodo_replication_data`. 2a. Decoding. Temperature = 0.7 (sampling on; top_p = 1.0). (Future prereg tests will use Temperature = 0.0 / greedy.) 3. Open the Notebook: Upload the `CPA_Coherence_AI_GPT4o_Replication.ipynb` file to your Google Drive and open it in Google Colab. 4. Mount Google Drive: In the notebook, ensure Google Drive is mounted. Cell 2 includes the code to do this. Run Cell 2. 5. Verify Setup: In Cell 1, confirm that the `GENERATE` flag is set to `False`. This ensures the notebook uses the provided static data instead of attempting to generate new data via API calls. Run Cell 1. 6. Install Dependencies: The notebook requires specific versions of Python libraries. You have two main options to ensure you have the correct environment: 1. Option A (Cell 1 pip): Run Cell 1 of the notebook. This cell contains `!pip install` commands that will attempt to install the necessary libraries with compatible versions directly within your Colab environment. 2. Option B (-r requirements.txt): Before running any analysis cells in the notebook (ideally as the very first step after mounting Drive), open a new code cell and execute the command `!pip install -r requirements.txt`. This will install the exact library versions listed in the `requirements.txt` file provided in the archive, ensuring your environment precisely matches the one used for the original analysis. Note: Running Cell 1 (Option A) is usually sufficient in Colab, but using the `requirements.txt` file (Option B) offers the highest guarantee of reproducing the exact software environment. 7. Run the Analysis and Generate Outputs: Execute all the remaining code cells in the notebook sequentially (Cells 2 onwards)]
Cell 2 will load the data files from your Google Drive Cell 3 will generate the 3-panel figure and automatically save it as `figs/3_panel_figure.png`. It will also save the summary dataframes as CSV files in the `output_data` folder (e.g., `output_data/df_summary_by_run_output.csv`). 8. Access Outputs: After the notebook has finished running, you can find the generated figure in the `figs` folder and the output CSV files in the `output_data` folder within your Colab environment's file browser. You can download these files from there. 3. Package Contents CPA_Coherence_AI_GPT4o Data gpt4o_summary_by_run.csv gpt4o_summary_by_constraint.csv gpt4o_summary_entropy.csv gpt4o_raw_main_data.csv (compressed) requirements.txt Figures 3_panel_figure.png (This was generated by the notebook) Colab Notebook CPA_Coherence_AI_GPT4o_Replication.ipynb README (This file) METHODS LICENSE CITATION 4. Data Schema The core data is contained in the /data/ CSVs. gpt4o_summary_by_run.csv: Contains run-level statistics (N=90 rows, 30 runs x 3 constraints).
o Columns: run_id, constraint, n_tokens, mean_surprisal, mean_entropy, seed. gpt4o_summary_by_constraint.csv: Aggregated means and 95% CIs for Panel A. gpt4o_summary_entropy.csv: Aggregated means and 95% CIs for Panel B. 5. Protocol & Statistics Protocol: The experiment consisted of 30 independent runs for each of the 3 constraint levels (low, medium, high), for a total of 90 runs. Each run used a fixed temperature and a unique seed based on a shared base value. Statistics: Primary: Trends are analyzed using Ordinary Least Squares (OLS) with constraint coded as an ordinal variable. Uncertainty is represented by 95% confidence intervals (CIs) derived from bootstrapping (n=10,000) on the run-level means. Secondary: The Thinking Fast & Slow scatter plot (Panel C) is analyzed using a Pearson r correlation. 6. Keywords CPA, Dynamic Present Theory, PMAC, constraint, entropy, surprisal, LLM 7. License This work is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0). See the (License.pdf) file for details. 8. Citation Please see the CITATION.cff file for the preferred citation format. 9. Related Identifiers This dataset is part of a larger body of work: Is Supplement To: 10.5281/zenodo.17451956 (Pilot AI-Coherence study) Is Part Of: 10.5281/zenodo.17069890 (Dynamic Present Theory I canonical paper)