Skip to content

XSLmodels

0.4.0Package record

Run and Optimize Cross-Situational Word Learning Models

0packages depend
113downloads / year
93.5%test coverage
12/12flavors OK

Overview

About

A collection of cognitive models of cross-situational word learning, together with methods and datasets for fitting and cross-validating them against experimental and corpus data, and for plotting the results.

Changes in 0.4.0

New Features

  • Added uncfam_elimination(), a variant of uncfam() with learning by elimination (mutual exclusivity). Each on-trial pair's mutual confidence P(o|w) * P(w|o) is computed from the current associations, and a pair gets *elimination support* to the extent that the trial's other words and objects are already accounted for by each other. That support, weighted by a free parameter eps, is added to uncfam()'s familiarity-and-uncertainty share of the trial's associative weight before renormalizing; eps = 0 reproduces uncfam() exactly. In uncfam(), an already-known pair on a trial draws weight *away* from the trial's other pairs; with elimination, knowing one word directs learning to the remaining word-object pairing. Motivated by the initial-accuracy experiment, where learners were more accurate on an initially mis-paired word the more of its study trials it shared with an initially accurate word. Registered in show_models()/xsl_model_registry()
  • Added uncfam_gamma(), a variant of uncfam() that decouples familiarity's contribution to a trial's attentional allocation from uncertainty's. uncfam()'s allocation weight is exp(B * entropy) * assocs -- entropy gets a free exponent (B), but familiarity (assocs) enters linearly with an implicit weight of 1 and no free parameter of its own. uncfam_gamma() adds one parameter, gamma, raising familiarity to a free power instead (assocs^gamma); gamma = 1 reproduces uncfam() exactly. Cross-validated against all of xsl_datasets, it beats plain uncfam() in every fold of a 5-fold split (mean test SSE 0.48 vs. 0.56), with a best-fit gamma around 0.3 (familiarity's pull *dampens* with diminishing returns). A separate analysis fitting this same free-gamma substrate to active cross-situational word learning (learners choosing which items to see named next, rather than a fixed passive sequence) instead found a best-fit gamma around 2 (amplified, not dampened) -- see ?uncfam_gamma for the full comparison
  • Added minerva2(), todam(), and rem(), three distributed/episodic memory models ported from standalone prototypes that predated this package (Hintzman's MINERVA2, 1984/1986; Murdock's TODAM, 1982; Shiffrin & Steyvers' REM, 1997) and were never wired into it or tested. All three represent words/objects as random feature vectors rather than tallying a single word-by-object association, and turn their native similarity/odds score into a Luce-choice-ready matrix via an exponentiated (X-temperature) or likelihood-ratio-based choice rule so they plug into get_perf()/mafc_test() like every other model here. Porting surfaced real bugs in the prototypes, fixed along the way (see each model's @details/source comments): minerva2()'s prototype compared a 2D echo-content vector against D-dim object vectors (silent recycling, not an error) instead of just the echo's object half; todam()'s prototype computed trial-1 attention weights as cos_sim(item, 0) = NaN, poisoning memory from the first trial on, and both todam() prototypes called the long-removed as.real(); rem()'s prototype never actually implemented REM at all (it declared a geometric feature-vector generator but its model/test functions were an unmodified copy of the MINERVA2 prototype's continuous-Gaussian code) -- rem() here is a fresh adaptation of Shiffrin & Steyvers' storage/odds equations to this package's associative task. Benchmarking (see ?minerva2/?todam/?rem performance notes) found rem()'s raw per-simulation likelihood-ratio odds span several orders of magnitude (a lucky match on one rare feature value can dominate), which would otherwise let a single lucky simulation hijack xsl_run()'s sum-across-simulations aggregation; rem() now row-normalizes each simulation's choice weights before returning them. All three are registered in show_models()/xsl_model_registry(), fitting only their choice-rule temperature (X) or storage parameters (g, u, c) by default -- D/w (feature-vector dimensionality) are fixed representational hyperparameters, not free cognitive parameters. Speed varies widely: on the full xsl_datasets (53 conditions) at n_sim = 500, minerva2() takes ~30s, todam() ~8 min, and rem() ~20 min -- todam()/rem() are impractical to xsl_fit() at full DEoptim settings (NP = 100, itermax = 100 would be tens of thousands of evaluations) without sharply reducing n_sim/NP/itermax, as the package's own fitting examples already do for slow models
  • Added 3 more temporal-contiguity conditions to xsl_datasets from Kachergis, Yu, & Shiffrin (2009) -- the same paper behind the existing 1_max_temp_spat_cont_orig/4_no_spat_orig_max_tc conditions. data-raw/XSL-dataset-fields.csv documented 6 "overlap" conditions (3 matched pairs of a control and non-control order at the same overlap degree) that were never pulled in; only the 3 control-order ones (1olap3tr_contr, temp_cont_1olap2tr_contr, temp_cont_2olap2tr_contr) have real subject-level accuracy data findable anywhere in the repo (in data-raw/agg_data/x13_1-21.txt, per export_data.R's own comments mapping its generic condition labels to these named orders). The other 3 have order files but no discoverable human data, and are deliberately left out rather than guessed. See data-raw/add_temporal_contiguity_overlap.R
  • Added a fifth standalone dataset, benitez2020 (a named list of 7 xslData objects, one per condition x age-group combination) from Benitez et al. (2020), "The temporal structure of naming events differentially affects children's and adults' cross-situational word learning" (data: osf.io/2hmxr). data-raw/Benitez2020-rep/Benitez2020_XSLdata_extraction.R already extracted training orders, 2AFC test trials, and response-count matrices from the raw OSF data but stopped short of building xslData objects (a literal # ToDo in the file); data-raw/add_benitez2020.R picks up from there. 8 symmetric word-object pairs, 12 training trials, 8-item 2AFC test; unlike the other standalone datasets, real per-word accuracy is recoverable directly from the provided response matrices (not just an overall mean) -- structurally it could join xsl_datasets directly, but is kept standalone by choice, as held-out generalization-test data (see xsl_holdout_datasets)
  • Added xsl_holdout_datasets, a registry of every dataset in the package that is *not* part of xsl_datasets and therefore never seen by get_group_model_fit()/get_crossvalidated_model_fit() -- i.e. everything available for testing a fitted model's generalization to genuinely held-out data, along with how to score each one (most need a different scoring approach than xsl_datasets's standard diagonal convention, which is exactly why they're standalone; benitez2020 and kachergis_initial_accuracy are the two directly-scorable exceptions, kept out of the fitting pool specifically to serve as held-out data)
  • Added a fourth standalone dataset, vlach_debrock2017 (Vlach & DeBrock, 2017, *Journal of Memory and Language*, "Remember dax? Relations between children's cross-situational word learning, memory, and language abilities"). 12 symmetric word-object pairs, 2 pairs per training trial, 36 trials, with pairs varying in whether their 6 repetitions are massed or spaced (n = 47 children, ages 2-5). The source only reports an overall mean/SD across all pairs and participants, not a per-word breakdown, so accuracy is NA throughout rather than fabricated -- kept standalone (not part of xsl_datasets) for the same reason as kachergis2012_highlighting/gangwani2011_category. See ?vlach_debrock2017 and data-raw/add_vlach_debrock2017.R
  • Added a third standalone dataset, gangwani2011_category (Experiment 1 of Gangwani, Kachergis & Yu, "Simultaneous Cross-situational Learning of Category and Object Names"; an undergraduate-journal version is Gangwani & Kachergis, *Indiana Undergraduate Journal of Cognitive Science* 5, 2010). A hierarchical design: each training trial shows 2 objects and names 3 words -- the two objects' own 1-to-1 names plus one 1-to-many "category" label naming those two objects and two others seen on other trials -- so every object carries both a basic name and a category label, and the paper's finding is that learners violate mutual exclusivity by learning both. A named list of three xslData objects (one per training block: ad hoc / natural / ad hoc), sharing one 36-trial co-occurrence schedule. Its 15 x 12 (word x object) association matrix breaks xslData's diagonal-scoring convention the same way kachergis2012_highlighting does, so it is kept standalone; score it with score_gangwani2011_category() in the new tests/bakeoff_comparison/gangwani2011_category_fit.R, which reads 12-AFC name accuracy, 3-AFC category accuracy, and the paper's headline ME-violation measure straight off any model's matrix. See ?gangwani2011_category and data-raw/add_gangwani2011_category.R

Other changes

  • control$start_matrix is no longer silently ignored. Only some models initialized from it; the rest dropped it without warning (so e.g. a familiarization phase passed as a start matrix simply vanished for them). Models now declare supports_start_matrix in xslMod(), and xsl_run() errors if a start matrix is given to one that doesn't, or if it doesn't match the training data's dimensions. baseline(), decay(), rescorla_wagner(), softmax_rl(), uncfam_sampling(), and multi_sampling() now support it, joining the uncfam() family, propose_but_verify(), and pursuit(). The remaining models (fazly(), guess_and_test(), tilles(), bayesian_decay(), kalman_filter(), fgt2009()/fgt2009_rsa(), minerva2()/todam()/rem()) have no single association matrix a start matrix maps onto (or would need a model-specific convention, e.g. a variance as well as a mean), so prior learning should be passed to them as training trials, as kachergis_initial_accuracy does. A custom model built with xslMod() must set supports_start_matrix = TRUE to receive one. Runs without a start matrix are unchanged

Documentation

Show all changes in 0.4.0Hide the rest of the changes in 0.4.0
  • The main vignette now covers every model and dataset added since 0.3.0 (uncfam_gamma(), uncfam_elimination(), minerva2()/todam()/rem(); vlach_debrock2017, benitez2020, xsl_holdout_datasets), and adds two sections: passing prior learning to a model as training trials vs. a start_matrix, and testing a fitted model's generalization on the held-out datasets. Its description of the dataset structure used field names (trials, objs, perf) that no longer exist -- so its create_cooc_matrix() example was silently printing an empty matrix -- and said words/objects must be referred to by index, which no longer holds

Bug Fixes

  • xsl_fit() with a parallel DEoptim backend (DEoptim.control(parallelType = "parallel")) silently returned bestval = Inf when control was passed as a variable (e.g. ctrl <- xslControl(n_sim = 100); xsl_fit(..., control = ctrl)): control was never forced, so the objective shipped to the worker processes carried an unevaluated promise that each worker tried to evaluate in its own empty global environment, every evaluation errored, and the error was converted to Inf. control is now forced before fitting, and xsl_fit() warns when every evaluation of a fit failed instead of returning an all-Inf result silently. Serial fits were unaffected.
  • create_cooc_matrix() looped over the number of distinct *words* rather than the number of trials: with more words than trials it errored, and with fewer (e.g. its own documented example, xsl_datasets[[1]]: 18 words, 36 trials) it silently tallied only the first trials. It also indexed by raw label (the same issue as #14). Both fixed; plot_training_trials() now indexes by label too. No model uses either function, so no fits change
  • propose_but_verify() and pursuit() drew new hypotheses with sample(tr_o, ...). On a trial with a single object, tr_o is one value, and when that value is an integer k, R's sample(k, n) draws from 1:k rather than returning k -- so a word seen alone with an object usually hypothesized a *different* object, one not even on the trial (propose_but_verify() hypothesized the right object ~1/8 of the time in an 8-object toy). Both now index into tr_o (tr_o[sample.int(length(tr_o), n, replace = TRUE)], as guess_and_test() already did). No xsl_datasets condition has single-object trials, so fits to it are unchanged; kachergis_initial_accuracy (18 single-object familiarization trials per condition), kachergis2012_highlighting's words-as-cues condition (28 trials naming two words with one object), and the naturalistic corpora (rollins_corpus, fm_corpus) are affected. Integer-labelled data (e.g. kachergis_initial_accuracy) was affected before this release too; the corpora were not -- they reached these models as string labels, for which sample() behaves as intended -- until #14 began handing models integer positions, so for the corpora this is a regression in 0.4.0.
  • Models indexed their association matrices by raw word/object value (m[tr_w, tr_o]) rather than by position in the sorted vocabulary, which is only correct for labels that are exactly 1..N (#14): a vocabulary with a gap crashed ("subscript out of bounds"), and a raw value that still fell in range silently updated the wrong row. Fixed once, in xsl_run(): models now receive each dataset's words/objects as positions, and the original labels are restored on the returned matrix, perf, and trajectory. Test trials are scored by label, and a start_matrix with dimnames is aligned to the data by label. Checked against every registry model on every bundled dataset (23 models x 75 datasets, fixed seed): 1721 of 1725 runs are bit-identical, including all of xsl_datasets and the standalone datasets, whose labels are already 1..N. The 4 that differ are propose_but_verify() and pursuit() on rollins_corpus/fm_corpus, where the fix corrects a real error: both compared a column *position* against the trial's object *labels*, which can never match for character labels, so on the corpora every hypothesis was treated as disconfirmed and none was ever verified. (Handing these models integer positions also exposed the single-object sample() bug above on the same corpora; both fixes are needed for correct corpus results.) The propose_but_verify and pursuit results previously in tests/bakeoff_comparison/corpus_report.md were therefore invalid (including pursuit's reported collapse on FM); the report and vignette("corpora") have been rerun on the fixed code
  • uncfam_predictive() now caps associations at beta (1), its stated maximum, as well as flooring them at 0. Its unnormalized update could overshoot far above beta on a word's first exposure: the prediction error is then ~beta, and it is scaled by exp(B * entropy) of the word's row, which update_known() spreads over every object seen so far -- so a word first seen after many others could reach an association in the thousands in a single trial (e.g. ~4600 for the 18th of 18 sequentially introduced words at X = .8, B = 1.6, C = .7). That association then dominated the word's row and collapsed its entropy, locking in the first pairing it was seen with; in the initial-accuracy study this made the model predict learners would choose an initially inaccurate word's familiarization referent 3-4x as often as they did. **This changes uncfam_predictive()'s fits** wherever the overshoot occurred, including the corpus-fit gains reported for it in tests/bakeoff_comparison/corpus_report.md (not rerun here)
  • get_perf() now treats negative associations as 0 before applying the Luce choice rule (as predict_referent() already did), and answers a word whose associations are then all 0 at chance (1 / ncol(m)) rather than returning NaN. Error-driven models (rescorla_wagner(), kalman_filter()) can learn negative associations, for which diag(m) / rowSums(m) gave per-item "probabilities" outside [0, 1] -- which DEoptim could exploit when fitting. In the initial-accuracy study, fitted rescorla_wagner() had negative associations for about half of participants and out-of-range predictions for 25 of 61. *

The NEWS section is longer than shown here.

From NEWS.md in the release

Install

Health

CRAN checks
12OK
Slowest check: 10.7 min · r-release-macos-x86_64
Status changes
  • OK12 OKNow
  • OK7 OK2026-10-19
Advisories

none known

Documentation

In release 0.4.0
READMEYes · 125 wordsVignettesYes · 2 · dynamicNEWSYes · 100% structured · mentions 0.4.0Citation fileNoWebsiteYes · pkgdown
Help pages
62 (5 internal)includes a package overview page
Examples that run
98%46 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
85%
Documented parameters
93%
Return-value docs
100%
Help pages citing references
0%

Downloads

113
CRAN downloads in the past year
Rank #25,593 · ~0/day · ~9/mo
XSLmodels
Daily download trend is not available in this view yet.
11330 days
11390 days
1131 year
Compare downloads with other packages →

Repository

0Stars
0Forks
0Open issues
1Open PRs
2Releases
145Commits
2Commit identities
License file reads as GPL-3.0 · 145 commits · Last activity 2026-10-16
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
26
Median days to close, 50 most recently updated closed PRs
0
PracticesBeta

8 development-tooling and community-health practices detected across 5 families in the upstream repository

Checks run against github.com/kachergis/xslmodels on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-16 · The repository has a site deploy workflow

pkgdown site last built 2026-10-16, before release 0.4.0 (2026-10-18)

Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Show all practicesHide 1 practice
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-07-11
    Pull request it wrote: opened by a project member
    Commits: at least 55 crediting it in the message
Models named in its commits
  • Claude Sonnet 531 commits · Jul to Oct 2026
  • Claude Opus 5.524 commits · Sep to Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
12 external dependencies (excludes base and recommended)

Installing XSLmodels adds 30 packages (16 with compiled code, 28 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, isoband 1.5 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (3)
Author, Maintainer since 0.4.0 (2026)
Releases (1)
  • 0.4.0Latest
    2026-10-18 · current release ·
    11 days in CRAN's queue
    Listed in CRAN's incoming queue from 2026-10-07 20:22 to 2026-10-18 12:19 UTC, in 55 readings.
  • R
    R 4.6.0 released · 2026-04-24
Across CRAN, the median accepted release of the past year spent 23 hours in the queue, 90% under 11 days.How queue time is measured

Package metadata

First published
2026-10-18
Total releases
1 / 1 yrs
License
GPL (>= 3) OSI
Minimum R
≥ 4.1.0
Bundled data
59 KB / 9 files
Download size
268 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("XSLmodels")
Kachergis, G., Braginsky, M., & Liang, K. (2026). XSLmodels: Run and Optimize Cross-Situational Word Learning Models (Version 0.4.0) [Computer software]. https://doi.org/10.32614/CRAN.package.XSLmodels

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for XSLmodels version 0.4.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy