Research artifacts · v0.1 preview

# Reproduce the Study

## Paper license

**CC BY-NC (Attribution-NonCommercial):** You may share and adapt this paper with appropriate attribution, but **only for noncommercial purposes**. [Read the CC BY-NC 4.0 license](https://creativecommons.org/licenses/by-nc/4.0/). See also [UC’s guide to choosing a Creative Commons license](https://help.oapolicy.universityofcalifornia.edu/support/solutions/articles/9000226762-which-creative-commons-license-should-i-choose-).

## Source revision and release status

No publication tag exists yet. The source revision inspected for this release is [`7da56f0cf75e7b10ac36d796b347bda6098f80fb`](https://github.com/ebelluti/Fall26-209_Final-embedding-model/tree/7da56f0cf75e7b10ac36d796b347bda6098f80fb); it is a baseline reference, not a frozen tag for the new publication changes. The release checklist tracks the remaining evidence freeze.

## Study A · Supplied word-order figures

Inputs: the supplied [interactive HTML](https://embedlab.vercel.app/attention/gender-bias-3d.html) and [histogram image](https://embedlab.vercel.app/attention/shift-distributions.png). Original dataset, sample manifest, experiment notebook, checkpoints, edited title strings, pooling, seeds, scaling sample, and nearest-neighbor IDs are missing. An independent model rerun cannot be specified honestly until those inputs are recovered.

```
# From repository root; Python standard library only
python3 frontend/scripts/export-attention.py
```

This command recovers 404 rounded hover rows per model and writes `frontend/src/data/attention-evidence.json` and a [downloadable JSON export](https://embedlab.vercel.app/attention/evidence.json). It recalculates Figure A1 and the illustrated product’s values; it does not regenerate embeddings, projections, or screenshots. Plotly 2.35.2 loads from the CDN in the supplied HTML; the table and PNGs work without WebGL or that CDN.

## Study B · Hypothesis 3 · Amazon UK text and image neighborhoods

The supplied [W209 notebook](https://embedlab.vercel.app/study-b/W209.ipynb) contains saved results for 450 matched products across 30 categories. MiniLM text embeddings and CLIP ViT-B/32 image embeddings use ten cosine neighbors across the full sample, excluding self. Purity and Jaccard overlap are averaged within categories, then equally across categories. These are separate from Hypothesis 2’s 72-product ABO sample and CLIP ViT-L/14 checkpoint.

```
# From repository root; Python standard library only
python3 frontend/scripts/export-cross-modal.py
# To extract a replacement supplied notebook:
python3 frontend/scripts/export-cross-modal.py /path/to/W209.ipynb
```

This extracts the two saved PNG charts and the rounded console summary without executing notebook code or downloading models. Notebook SHA-256: `5b7f8599a428af5f829b554ad1ea44eee5e41a7ab50bed7d63ee2def5940f84b`. The [evidence JSON](https://embedlab.vercel.app/study-b/evidence.json) records model IDs, sample counts, summary measures, and chart hashes. To rerun the analysis, open the notebook in Jupyter and set `DATA_CSV_PATH` to the Amazon UK CSV. Its imports require NumPy, pandas, Plotly, requests, PyTorch, Pillow, scikit-learn, sentence-transformers, transformers, Matplotlib, and Jupyter/IPython. No pinned environment, original vector arrays, product manifest, or per-category CSVs are included, so this extraction does not establish exact scientific reproducibility.

## Study B · Hypothesis 2 · ABO text and image comparison

Use Python 3.11+, `uv`, Node.js 22, network access to ABO and Hugging Face, disk space for listings/images/model caches, and the checked-in Python lockfile. The original vectors and prepared data are local ignored artifacts; checked-in frontend results render without them. First-time inference downloads weights and can take substantial time.

```
cd abo-embedding-benchmark
uv sync
mkdir -p data/raw
curl --fail --location \
  https://amazon-berkeley-objects.s3.us-east-1.amazonaws.com/archives/abo-listings.tar \
  -o data/raw/abo-listings.tar
tar -xf data/raw/abo-listings.tar -C data/raw
uv run python src/prepare_data.py
uv run python src/wording_study.py prepare
uv run python src/wording_study.py run
uv run python -m unittest discover -s tests -v
cd ..
npm run setup
npm run data:refresh
npm run build
```

The fixed source corpus fingerprint is `faea9ebc21d8f3662724629d4f266c6838149df8241f408460be062cb5f404eb`; final cohort fingerprint: `e20ad533cdf521f0b1f10898f480b0a941188311d435c45c6bb93e36fbd69439`. Seed 42, k=10, 999 within-type permutations. The cohort manifest was created 2026-10-28T15:57:12.039621+00:00. Compare fingerprints before claiming the same run. The current pipeline resolves model defaults; to recreate the original weights exactly, use the saved revisions below rather than assuming a current default is identical.

## Saved model inventory

| Checkpoint | Revision / features | Input and pooling |
| --- | --- | --- |
| TF-IDF 659 dimensions | `unigrams + bigrams; max_features=50,000` | title + attributes; TF-IDF; no text-token cap |
| [google/embeddinggemma-300m](https://huggingface.co/google/embeddinggemma-300m) 768 dimensions | `57c266a740f537b4dc058e1b0cda161fd15afa75` | title + attributes; no retrieval prompt; model-defined; 256-token cap |
| [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) 1024 dimensions | `97b0c614be4d77ee51c0cef4e5f07c00f9eb65b3` | title + attributes; no retrieval prompt; last non-padding token; 256-token cap |
| [openai/clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) 768 dimensions | `32bd64288804d66eefd0ccbe215aa642df71cc41` | pixels only; CLIP projected image embedding; no text-token cap |

All vectors are L2-normalized. CLIP uses checkpoint image preprocessing. Neural text receives no retrieval prefix. Saved package versions: torch 2.7.1; transformers 4.51.3; sentence-transformers 3.4.1; scikit-learn 1.9.1; pillow 13.0.0. Sentence Transformers pooling is model-defined; Qwen uses the last real token. See the source for full preprocessing and tie handling.

## Figure and result outputs

- Figure A1 and title example: `export-attention.py` → `attention-evidence.json`; source HTML and two static images under `frontend/public/attention/`.
- Figure B1 and linked explorer: `wording_study.py` → `results/wording-study/study.json`, `summary.csv`, original-space `.npy` vectors; `npm run data:refresh` validates and exports `frontend/src/data/wording-study.json`.
- Prepared cohort, review CSV, image hashes and manifest: `data/processed/wording-study/`. Images and model caches remain local.

## Playground · Separate 1,600-product catalog

The demo contains 100 products in each of 16 categories and includes titles without gendered wording. Saved suggested queries work offline; arbitrary queries require the local Python API and local vectors.

```
# From abo-embedding-benchmark/
uv run python src/recommendations.py --refresh-catalog --per-category 100
uv run python src/recommendations.py
uv run python src/recommendations.py --serve
# Set in frontend/.env.local, then restart Next.js:
# RECOMMENDATIONS_API_URL=http://127.0.0.1:8100
```

The catalog refresh downloads images and encodes all four indexes; it is not needed to view published results. Outputs are the two frontend recommendation JSON snapshots and local `results/recommendations/` vectors. No new model runs were needed for this publication implementation.

## Access, licensing and checks

Review the [ABO dataset and license](https://amazon-berkeley-objects.s3.us-east-1.amazonaws.com/index.html) before redistributing listings or images. Catalog images retain their source attribution. Each model card specifies its own license; access to gated checkpoints, if required for Study A, must be arranged by the reproducer. Original Study A source provenance and redistribution terms remain publication blockers.

```
npm --prefix frontend run lint
npm --prefix frontend run typecheck
npm run build
npm run test:e2e
# With the local app running:
npm --prefix frontend run publication:pdf
```

Browser checks require an installed Google Chrome and a production build. Source: [https://github.com/ebelluti/Fall26-209_Final-embedding-model](https://github.com/ebelluti/Fall26-209_Final-embedding-model). Deployment is a separate step and is not performed by these commands.

---

Canonical page: https://embedlab.vercel.app/reproduce

Find setup instructions, commands, saved model revisions, source artifacts, and limitations for reproducing the product embedding studies.

Interactive controls are available on the browser page. Saved results are described in the study and reproducibility guide.

Citation: Belluti, E., Perez, I., & Zhang, H. (2026). What Product Embeddings Treat as Similar: Word Order, Input Modality, and Gendered Catalog Wording in E-commerce. UC Berkeley MIDS · DATASCI 209 · Fall 2026. Version 0.1, research preview. https://embedlab.vercel.app/study

[Agent guide](https://embedlab.vercel.app/llms.txt) · [Sitemap](https://embedlab.vercel.app/sitemap.xml)
