Representation learning
Separate Input Cleaning from Catalogue Truncation
Use one data foundation to distinguish adding activity evidence, removing controlled template noise and discarding context. The interventions produce different errors.
Source case: Square. The article separates the published design from the data, methods and observations in this local experiment.
A complete catalogue can reinforce the wrong activity
A payments analyst groups merchants for portfolio reporting. A business name suggests one activity; a catalogue contains something else. Some entries describe actual offerings, while others are unchanged starter content generated from an onboarding choice. Simply adding the whole catalogue can make the original mistake appear independently confirmed.
Square’s March 2025 account identifies the starting problem:
“merchant self-selection is highly susceptible to miscategorization”
It describes reviewed labels, post-onboarding information and a RoBERTa classifier. Preprocessing removes unchanged auto-created entries and ranks retained items by purchase frequency. Original engineering article
The useful experiment is therefore not simply names versus names-plus-catalogue. It should separate additional information, source cleaning and input-budget choices so their effects remain distinguishable.
Read the workflow as a division of responsibility
Open full-size diagram (opens in a new tab)Square’s original workflow. Input construction and the target label require different evidence and review.
The separate feature and label branches are consequential. Removing a misleading starter service cannot repair a target copied from the same unreliable onboarding choice. Likewise, an improved target cannot recover a relevant activity excluded from the input.
My proposed review process would first define what activity is being classified, which evidence supports it and how mixed businesses are handled. Reviewers could inspect descriptions without the existing category to reduce anchoring. An operational override would record whether it corrects a prediction, expresses a policy exception or compensates for missing information before entering a later training set.
The new experiment uses a narrower version of that separation. I authored training labels and summaries. A separate model agent reviewed name-masked diagnostic descriptions before predictions, without seeing model outputs. Its reference file is frozen with the reviewed-text and taxonomy hashes. This is second-model-agent development review, with no human industry annotation or independent population estimate.
Make the contaminating evidence explicit
The corpus contains selected public facts about twenty-four companies: sixteen training entities and eight different diagnostic entities. Four additional diagnostics isolate negation, mixed activities and missing information. Each public observation has an official source URL and observation date. The short descriptions are my paraphrases, not company catalogue telemetry or complete legal-entity profiles.
For example, the Landor observation summarises brand strategy and visual, verbal, sonic and motion expression from its official site. Its experimental record also contains this separate input:
| Input component | Origin and role |
|---|---|
| Brand-strategy and expression observations | Selected public facts, paraphrased by the author |
| Printed shirts and business cards | Controlled starter-template overlay; not a Landor offering claim |
| Frequency 1,000 on that overlay | Authored ordering metadata; not observed sales or word weighting |
The raw arm retains that overlay. The clean arm removes only entries marked auto-created and unedited. Other entries retain the same text and ordering. The Landor prediction changes from C2 to C1, agreeing with the review reference after cleaning. This illustrates the intervention; it does not prove that the exact source of a model error has been causally identified.
def selected_items(row, arm):
items = sorted(row["catalog"], key=lambda item: (-item["frequency"], item["id"]))
if arm in ("clean", "truncated"):
items = [item for item in items if not item["auto_created"] or item["edited"]]
return items[:1] if arm == "truncated" else itemsFrequency controls which clean entry survives top-one selection. It does not duplicate or weight words. Raw and clean naive Bayes inputs are bags of words, so their ordering alone cannot change a prediction. This tests retaining different content under an authored policy, not the value of real purchase-frequency data.
Origin and edit flags are supplied fields, not model discoveries. One diagnostic also contains an explicit author scope clarification, which is marked separately from public facts. These curation choices matter: a real deployment would need evidence that its metadata reliably distinguishes starter content from genuine activity.
Change one input condition at a time
All four arms use multinomial naive Bayes, the same sixteen training entities, training labels and Laplace smoothing. Each representation is fitted separately because its vocabulary changes. This is a representation-pipeline ablation across training and diagnosis, not a frozen model receiving different inference inputs.
| Arm | Input change | Leaf agreement | Parent agreement |
|---|---|---|---|
| Name | Company name alone | 2 / 8 | 4 / 8 |
| Raw | Add all catalogue entries | 5 / 8 | 6 / 8 |
| Clean | Remove only unchanged starter entries | 6 / 8 | 7 / 8 |
| Truncated | Keep only the first clean entry by authored frequency | 2 / 8 | 4 / 8 |
The raw-to-clean contrast isolates the removal policy. The clean-to-truncated contrast isolates retaining less information. The total lexical word-token count across twelve clean diagnostics falls from 267 to 96 after truncation. Those are this tokenizer’s counts, not encoder tokens or API charges. Every clean record has three entries, so the truncation actually discards two entries rather than merely claiming a token-budget intervention.
For FreeAgent, keeping only the opening statement about entering statements, invoices and expenses loses the subsequent application behaviour. The prediction changes from accounting software to managed accounting. Frequency is a proxy for relevance, and this deliberately tight budget removes the distinction the task needs.
More context helps here without establishing semantic robustness
The model distinguishes eight teaching leaves in four parent families: food, personal care, business support and creative work. A parent-level match preserves useful diagnostic information without making a wrong leaf correct. These labels describe the supplied activity; they are not MCCs or NAICS assignments.
Cleaning is not a monotone accuracy operation. The negation diagnostic denies performing bookkeeping and instead describes browser tools customers use themselves. The clean bag-of-words model still assigns managed accounting. Its raw counterpart happens to select software. Vocabulary and likelihood changes can move a small fitted model in either direction; a correct raw label does not validate its contaminating template.
All four CPU arms also force a category on all four review references. There is no validated uncertainty threshold. One real-company observation mentions custom production and fulfillment but omits printing-specific evidence; the reviewer therefore retained REVIEW. The test does not silently convert public brand familiarity into missing activity evidence.
The next modelling comparison should add a stronger linear text baseline before an encoder. Negation, paraphrases and relationships between services are reasons an encoder might help; the current evidence does not establish that it would. Two training entities per leaf and author-curated wording remain substantial limitations. Merchant-separated examples reduce direct entity reuse, while the selection and wording of the corpus still influence the outcome.
Inspect all input arms, source references and retained diagnostic errors
What the experiment actually shows
One controlled input condition changes at each step; the fitting algorithm, training entities, labels and smoothing stay fixed.
Data and comparison boundary
Methods compared
- name
- Company name only
- raw
- Name plus all catalogue entries
- clean
- Remove only unchanged auto-created entries
- truncated
- Keep only the highest-frequency clean entry
Recorded findings
- name
- 2 / 8
Leaf agreement; parent agreement 4/8; 4 forced assignments on review references.
- raw
- 5 / 8
Leaf agreement; parent agreement 6/8; 4 forced assignments on review references.
- clean
- 6 / 8
Leaf agreement; parent agreement 7/8; 4 forced assignments on review references.
- truncated
- 2 / 8
Leaf agreement; parent agreement 4/8; 4 forced assignments on review references.
Inspect a recorded example
D01 · Sweetgreen
Sweetgreen | Offering: A browser application for invoicing.; Customers choose seasonal ingredients for a meal.; This location offers salads, warm bowls and wraps.; Guests can order food for pickup.
Baseline output
Name: B1 Raw: F1
Candidate output
Clean: F1 Truncated: C2 Truncated input: Sweetgreen | Offering: Customers choose seasonal ingredients for a meal.
D02 · RAVE Coffee
RAVE Coffee | Offering: Beauty serums and makeup sold in bottles.; Subscribers choose flavour preferences and grind format.; Monthly parcels contain roasted beans for home or office brewing.; Deliveries can be paused or skipped.
Baseline output
Name: F2 Raw: F2
Candidate output
Clean: F2 Truncated: F2 Truncated input: RAVE Coffee | Offering: Subscribers choose flavour preferences and grind format.
D03 · Massage Envy
Massage Envy | Offering: Bags of roasted beans shipped to homes.; Members arrange a regular wellness session.; The session can be therapeutic massage, assisted stretch or a customized facial.; Customers receive care at a franchised location.
Baseline output
Name: B1 Raw: B2
Candidate output
Clean: P1 Truncated: C2 Truncated input: Massage Envy | Offering: Members arrange a regular wellness session.
D04 · Cult Beauty
Cult Beauty | Offering: Prepared hot drinks and meals.; The retailer curates discoveries from many brands.; Its online offering consists of beauty products and selected product edits.; Customers purchase items rather than booking a treatment in this description.
Baseline output
Name: B1 Raw: P2
Candidate output
Clean: P2 Truncated: P2 Truncated input: Cult Beauty | Offering: The retailer curates discoveries from many brands.
D05 · 1-800Accountant
1-800Accountant | Offering: Bookkeeping and tax work performed for clients.; Small businesses obtain virtual help with financial administration.; Accountants provide tax and bookkeeping services.; The described offering is work performed for business clients.
Baseline output
Name: B1 Raw: C2
Candidate output
Clean: C1 Truncated: B2 Truncated input: 1-800Accountant | Offering: Small businesses obtain virtual help with financial administration.
D06 · FreeAgent
FreeAgent | Offering: Salon appointments and hair styling.; The customer enters statements, invoices and expenses.; The application builds business accounts in the background.; Reports include a balance sheet, profit and loss and aged debtors.
Baseline output
Name: B1 Raw: B2
Candidate output
Clean: B2 Truncated: B1 Truncated input: FreeAgent | Offering: The customer enters statements, invoices and expenses.
D07 · Landor
Landor | Offering: Printed shirts and business cards.; Clients receive help connecting business strategy to a brand.; The work uses visual, verbal, sonic and motion expression.; Customer and employee experiences are designed across physical and digital settings.
Baseline output
Name: B1 Raw: C2
Candidate output
Clean: C1 Truncated: B2 Truncated input: Landor | Offering: Clients receive help connecting business strategy to a brand.
D08 · Printful
Printful | Offering: Brand identity and graphic direction.; An online seller connects its store to this supplier.; Custom products are produced and orders fulfilled on the sellers behalf.; The described company supplies physical goods and fulfillment, not just creative advice.
Baseline output
Name: B1 Raw: B2
Candidate output
Clean: C2 Truncated: B2 Truncated input: Printful | Offering: An online seller connects its store to this supplier.
D09 · Neutral Studio
Neutral Studio | Offering: Bags of roasted beans shipped to homes.; We do not perform bookkeeping for clients.; Customers use our browser tools to prepare their own invoices and reconcile their bank records.; No accountants are hired to complete clients books under this description.
Baseline output
Name: B1 Raw: B2
Candidate output
Clean: B1 Truncated: C1 Truncated input: Neutral Studio | Offering: We do not perform bookkeeping for clients.
D10 · Counter and Cart
Counter and Cart | Offering: Bags of roasted beans shipped to homes.; The business prepares drinks for visitors.; It also ships packaged coffee beans to online buyers.; No activity share or primary operation is established.
Baseline output
Name: B1 Raw: F2
Candidate output
Clean: F2 Truncated: B2 Truncated input: Counter and Cart | Offering: The business prepares drinks for visitors.
D11 · Care and Cabinet
Care and Cabinet | Offering: Bags of roasted beans shipped to homes.; Appointments provide facial treatments.; A separate catalogue sells skincare bottles for home use.; The record establishes neither activity as primary.
Baseline output
Name: B1 Raw: F1
Candidate output
Clean: P2 Truncated: C2 Truncated input: Care and Cabinet | Offering: Appointments provide facial treatments.
D12 · General Solutions
General Solutions | Offering: Bags of roasted beans shipped to homes.; We help ideas become real.; Our team supports businesses and individuals.; The supplied record does not say what is sold or performed.
Baseline output
Name: B1 Raw: F1
Candidate output
Clean: B1 Truncated: C2 Truncated input: General Solutions | Offering: We help ideas become real.
These are saved results. Switching examples runs no model or external service.
Limits of this experiment
- Paraphrases are author-curated observations, not complete company profiles or naturally sampled merchant logs.
- The multinomial model has only two training entities per leaf. All four models force a class; no calibrated review threshold is claimed.
- Controlled overlays let us isolate interventions but cannot estimate a real template-contamination rate.
Inspect the recorded provenance
{
"calls_sha256": "28a8ec63cffb3fb0aa65b37ff0c2c59f5c49e148a7dda8adb4c339b026cdd584",
"corpus_sha256": "acd2d0abbc8001114d56dd2de69535a01006df455666f17ea746fc8d234a4b26",
"cpu_code_sha256": "e43da0368fb32d502c85c881d064c342cf685284c5bfc4e93b1e2e1c4d8fdf44",
"evaluation_code_sha256": "b74376be594e4e39eae52f87c10637ec49fc3d45c982cc7a197a5cc447d2ed9a",
"initial_infrastructure_trial": {
"file": "calls.json",
"http_requests": 36,
"model": {
"details": {
"families": [
"qwen3vl",
"clip"
],
"family": "qwen3vl",
"format": "gguf",
"parameter_size": "4.0B",
"parent_model": "",
"quantization_level": "Q4_K_M"
},
"digest": "8708ab6acc5eed95c57d3d4b68c08f85eb197840827c097c7d9ed49f2a030c6e",
"model": "qwen3-vl:4b-instruct-q4_K_M",
"modified_at": "2026-11-25T21:56:46.663784614+01:00",
"name": "qwen3-vl:4b-instruct-q4_K_M",
"size": 3337226771
},
"reason": "Runtime 0.17.7 runner failures; the separately recorded compatible trial also reports a different API model identity. Identical request bodies do not make this a controlled runtime-only comparison.",
"runtime": {
"version": "0.17.7"
},
"sha256": "6a3cade5caa2e40d3c881878ca0e08ef67062bf711f2716fc8038dbea9ebdaeb",
"successful_generations": 0
},
"model": {
"capabilities": [
"completion",
"vision",
"tools"
],
"details": {
"context_length": 262144,
"embedding_length": 2560,
"families": [
"qwen3vl",
"clip"
],
"family": "qwen3vl",
"format": "gguf",
"parameter_size": "4.0B",
"parent_model": "dhiltgen/qwen3-vl:4b-instruct-q4_K_M-llamacpp",
"quantization_level": "Q4_K_M",
"runner": "llamacpp"
},
"digest": "84f7ed8042fa7cdbd902f7dcb7d0370e032095047cc3244179f263b77b5bc318",
"model": "qwen3-vl:4b-instruct-q4_K_M",
"modified_at": "2026-11-25T21:56:46.65935228+01:00",
"name": "qwen3-vl:4b-instruct-q4_K_M",
"size": 3337225651
},
"model_counts_sha256": "66dfd8df9a4ffd1560a1b6cac41b912f5573c38261c1b289fc069804353a3310",
"recording_basis": {
"blind-review.json": "cb7640961bf72159202cd0a0ce3ff7157f66d97cd5ba811fb539e062f434fcdf",
"core.py": "e43da0368fb32d502c85c881d064c342cf685284c5bfc4e93b1e2e1c4d8fdf44",
"corpus.json": "acd2d0abbc8001114d56dd2de69535a01006df455666f17ea746fc8d234a4b26",
"reference.json": "2f2e816462abeb8b10d87c414a7e2433b22215c8c42295a6d1a5df6f11e184ab",
"run_compatible_model.py": "26f6988e7fdf106aa92a544e90a3172f29348aba557caa59120f62786b26e070",
"run_model.py": "3a91a34d5e3f3280e0ba5eccc8122bf0c756f8cfc47cd4712d1ea671b0b74f92",
"taxonomy.json": "5971417e205c466d5de873f3616498cb5271e67ed3333c9d95e02568bf2e1737"
},
"reference_sha256": "2f2e816462abeb8b10d87c414a7e2433b22215c8c42295a6d1a5df6f11e184ab",
"reviewer": "Second model agent, separate from the source/data author; not a human industry annotation or independent population test",
"runtime": {
"version": "0.40.18"
},
"selected_trial": "calls-compatible.json",
"source_manifest_sha256": "81a769e36044ad32931d66c78a2a863846d5131082af485dbb0ad85d54015740",
"taxonomy_sha256": "5971417e205c466d5de873f3616498cb5271e67ed3333c9d95e02568bf2e1737",
"token_note": "API counters are retained literally, including cache counters. These are not invoices, a latency benchmark or a complete provider-cost comparison."
}def model_text(row, arm):
if arm == "name":
return row["name"]
return row["name"] + " | Offering: " + "; ".join(item["text"] for item in selected_items(row, arm))A reusable prediction needs more than an unchanged merchant name
Square describes daily predictions and reusing earlier predictions for unchanged inputs. Source: inference section
My proposed cached assignment would bind canonical input, preprocessing version, model/tokenizer version and taxonomy policy. A new category policy may require inference even when the seller changed nothing. Conversely, an unrelated profile field should not automatically trigger expensive work.
Keep historical predictions separate from current accepted assignments. A reviewed override should retain its reason and applicability; a new model should not silently erase it. Those are operational design requirements, not implemented services in this CPU study.
Keep the evidence policy, then decide whether a model earns deployment
For a merchant-data workflow, the present decision is to retain full cleaned activity context for further work and reject this aggressive top-one budget. The six-of-eight classifier is not ready to set eligibility, fees or externally governed payment codes. A segmentation label, its review policy and a payment-code decision are different contracts.
The Ramp companion uses the same diagnostic descriptions but tests definition retrieval and a name-masked selector. It asks a different question: can a model decide among candidate meanings or recognise that none is sufficiently supported? Treating these articles as two views of one data foundation makes their reuse visible rather than inflating the number of independent experiments.
Sources, earlier experiment and offline reproduction
The unchanged workflow figure credits Square’s article, published 10 March 2025, CSV row 47. Official company URLs and author-scope notes are in the new corpus and source manifest. Controlled templates and frequency fields remain explicitly authored.
The earlier 24-training/12-diagnostic fictional study and its recorded calls remain unchanged in engineering-lab/classification. The revision adds engineering-lab/merchant-study; it does not replace those artifacts. In the new standalone directory, run python3 run.py, python3 verify_recording.py and python3 smoke.py. Reproduction refits CPU baselines and rechecks saved responses without model calls.