https://github.com/google-deepmind/recoglab

https://github.com/google-deepmind/recoglab

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: google-deepmind
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 243 KB
Statistics
  • Stars: 8
  • Watchers: 7
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Created about 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Contributing License

README.md

ReCogLab

[Paper] | [Colab]

This codebase accompanies the paper:

ReCogLab: A Framework Testing Relational Reasoning & Cognitive Hypotheses on LLM \ Andrew Liu, Henry Prior, Gargi Balasubramaniam, Rivka Moroshko, Amir Zait, Ilia Labzovsky, Danny Karmon, Ishita Dasgupta, Kim Stachenfeld, Kenneth Marino

For correspondence about this project, please contact {ahliu,hprior,gargisb,kmarino}@google.com

About

ReCogLab is a generative framework designed to allow researchers in cognitive science and NLP to quickly prototype language model experiments on a wide variety of relational reasoning. Our framework automatically generates relational reasoning word problems that can be used to probe for cognitive effects and diagnosing reasoning capabilities in Large Language Models (LLMs). This includes generating more challenging examples along multiple dimensions such as the number of entities, length of reasoning, use of filler and flavor text.

Several transitive inference capabilities of tasks that we can generate configurations for include:

  • Basic Transitive Inference: Generate problems that evaluate basic transitive inference reasoning skills. # Question Dog is bigger than Apple. Dog is smaller than Fire truck. Is apple smaller than Fire truck? # Answer No
  • Graph Traversal: Generate problems that evaluate multi-hop reasoning skills. # Question Anna is friends with Bob. Bob is friends with Carl. Bob is friends with Dana. If a messsage can be exchanged between people who are friends, if Dana wants to pass a message to Anna, what's the exact path of friends that will receive the message? # Answer ['Dana', 'Bob', 'Anna']
  • Consistency Detection: Generate problems that evaluate detecting logically inconsistent statements. # Question Dog is bigger than Apple. Dog is smaller than Fire truck. Fire truck is smaller than Apple. Are the above statements consistent or inconsistent with each other? # Answer Inconsistent
  • Determinacy / Indeterminacy / Feasibility: Generates problems and ask whether sufficient information has been provided to answer the question. # Question Dog is bigger than Apple. Dog is smaller than Fire truck. Dog is smaller than Van. Is Van bigger than Fire truck? # Answer Unknown ## Colab Demo We have a Colab demo that contains configurable form to generate common examples with. For more information about how each form's field affects ReCogLab see recoglaboptionsdocumentation.pdf

Loading ReCogLab Datasets

ReCogLab generated datasets are encoded using TFRecords and Python strings. This makes it straightforward to load your generated dataset without needing ReCogLab again. Please see the Colab demo for an example of loading a ReCogLab tfrecord.

Local Installation and Usage

We recommend using virtualenv to manage ReCogLab's dependency. See instructions for installing virtualenv. For ICLR 2025, we use jax==0.4.33, jaxlib==0.4.33. Jax PRNGKeys are not deterministic across versions so to reproduce our experimental results exactly, one must use v0.4.33 JAX.

```bash git clone https://github.com/google-deepmind/recoglab.git virtualenv recoglab_venv

source recoglabvenv/bin/activate # enters the recoglab virtualenv system pip install -r requirements.txt # installs the necessary packages to recoglabvenv ```

Now we can call python -m recoglab.generate_static_dataset to call the predefined ReCogLab binary. This will write the .tfrecord of examples and .config to output_path.

bash python -m recoglab.generate_static_dataset \ --recoglab_configuration_str="feasibile_infeasible_tree" \ --split="test" --output_path="/tmp/test" --num_examples=50 --seed="42"

recoglab_configuration_str are predefined configurations that we used for basic Social Network, Comparison, Syllogism, and Family JSON experiments. This can be customized or one can implement your own module of relational reasoning. Statement can be overridden through the command line argument

bash python -m recoglab.generate_static_dataset \ --recoglab_configuration_str="feasibile_infeasible_tree" \ --split="test" --output_path="/tmp/test" --num_examples=50 --seed="42" \ --config_overwrite="num_entities_gen=10"

We also provide iclr_dataset.sh to reproduce the datasets that we generated for experimental results used in our paper.

Citing this work

bibtex @inproceedings{ liu2025recoglab, title={ReCogLab: a framework testing relational reasoning, cognitive hypotheses on {LLM}s}, author={Andrew Liu and Henry Prior and Gargi Balasubramaniam and Rivka Moroshko and Amir Zait and Ilia Labzovsky and Danny Karmon and Ishita Dasgupta and Kim Stachenfeld and Kenneth Marino}, booktitle={The Thirteenth International Conference on Learning Representations}, year={2025}, url={https://openreview.net/forum?id=yORSk4Ycsa} }

License and disclaimer

Copyright 2025 Google LLC

All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the Apache 2.0 license at: https://www.apache.org/licenses/LICENSE-2.0

All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode

Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

This is not an official Google product.

Owner

  • Name: Google DeepMind
  • Login: google-deepmind
  • Kind: organization

GitHub Events

Total
  • Watch event: 5
  • Push event: 5
  • Pull request event: 1
  • Create event: 4
Last Year
  • Watch event: 5
  • Push event: 5
  • Pull request event: 1
  • Create event: 4

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 12
  • Total Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.333
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Andrew Liu a****u@g****m 8
DeepMind n****y@g****m 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2) python (2)

Dependencies

requirements.txt pypi
  • Markdown ==3.7
  • MarkupSafe ==3.0.2
  • PyYAML ==6.0.2
  • Pygments ==2.19.1
  • Werkzeug ==3.1.3
  • absl-py ==2.1.0
  • astunparse ==1.6.3
  • certifi ==2024.12.14
  • charset-normalizer ==3.4.1
  • click ==8.1.8
  • flatbuffers ==25.1.24
  • gast ==0.6.0
  • google-pasta ==0.2.0
  • grpcio ==1.70.0
  • h5py ==3.12.1
  • idna ==3.10
  • immutabledict ==4.2.1
  • jax ==0.4.33
  • jaxlib ==0.4.33
  • joblib ==1.4.2
  • keras ==3.8.0
  • libclang ==18.1.1
  • markdown-it-py ==3.0.0
  • mdurl ==0.1.2
  • ml-dtypes ==0.4.1
  • ml_collections ==1.0.0
  • namex ==0.0.8
  • networkx ==3.4.2
  • nltk ==3.9.1
  • numpy ==2.0.2
  • opt_einsum ==3.4.0
  • optree ==0.14.0
  • packaging ==24.2
  • protobuf ==5.29.3
  • regex ==2024.11.6
  • requests ==2.32.3
  • rich ==13.9.4
  • scipy ==1.15.1
  • six ==1.17.0
  • tensorboard ==2.18.0
  • tensorboard-data-server ==0.7.2
  • tensorflow ==2.18.0
  • tensorflow-io-gcs-filesystem ==0.37.1
  • termcolor ==2.5.0
  • textblob ==0.19.0
  • tqdm ==4.67.1
  • typing_extensions ==4.12.2
  • urllib3 ==2.3.0
  • wrapt ==1.17.2