From Explicit Elements to Implicit Intent: A Predefined Library for Auditable Behavioral Inference

arXiv cs.AI Papers

Summary

Presents SemantiClean, a modular framework for extracting structured semantic signals from e-commerce session data to drive pluggable inference targets (purchase intent, customer segmentation, product affinity) while prioritizing auditability and structural transparency over pure accuracy.

arXiv:2606.11207v1 Announce Type: new Abstract: We present SemantiClean, a modular framework for extracting structured semantic signals from e-commerce session data and driving pluggable inference targets including purchase intent, customer segmentation, and product affinity through a shared element library. Unlike conventional end-to-end predictors that optimise solely for accuracy, SemantiClean prioritises auditability, structural governance, and sigma=0 reproducibility, explicitly trading marginal predictive gains for element-level transparency and defensible decision trails. Built upon the Online Shoppers Purchasing Intention (OSPI) dataset, the framework organises twenty-four behavioural elements into a four-layer architecture (Functional, Interaction, Systemic, Contextual) and enforces signal quality through three anti-inflation mechanisms: RedundancyGroup contribution caps, TieredPenaltyCalculator bias penalties, and AdaptiveConstraintMode cold-start protection.This report introduces the LLM-Integrated Semantic Inference Engine, a fully implemented two-phase LLM-driven inference architecture that leverages complete element metadata at inference time. All quantitative results reported herein are produced by this engine. Deterministic engine outputs remain fully reproducible (sigma=0); LLM-dependent results (E8, E10) are subject to controlled output variability under fixed provider/model/temperature settings. The gender inference target remains non-functional in the current implementation and is excluded from all quantitative results.
Original Article
View Cached Full Text

Cached at: 06/11/26, 01:46 PM

# From Explicit Elements to Implicit Intent: A Predefined Library for Auditable Behavioral Inference
Source: [https://arxiv.org/html/2606.11207](https://arxiv.org/html/2606.11207)
###### Abstract

We presentSemantiClean, a modular framework for extracting structured semantic signals from e\-commerce session data and driving pluggable inference targets—including purchase intent, customer segmentation, and product affinity—through a shared element library\. Unlike conventional end\-to\-end predictors that optimise solely for accuracy, SemantiClean prioritises auditability, structural governance, andσ=0\\sigma=0reproducibility, explicitly trading marginal predictive gains for element\-level transparency and defensible decision trails\. Built upon the Online Shoppers Purchasing Intention \(OSPI\) dataset \(UCI Repository ID 468; 12,330 sessions, 18 features\), the framework organises twenty\-four behavioural elements into a four\-layer architecture \(Functional, Interaction, Systemic, Contextual\) and enforces signal quality through three anti\-inflation mechanisms: RedundancyGroup contribution caps, TieredPenaltyCalculator bias penalties, and AdaptiveConstraintMode cold\-start protection\.

This report introduces theLLM\-Integrated Semantic Inference Engine, a fully implemented two\-phase LLM\-driven inference architecture that leverages complete element metadata at inference time\. All quantitative results reported herein are produced by this engine\. Deterministic engine outputs remain fully reproducible \(σ=0\\sigma=0\); LLM\-dependent results \(E8, E10\) are subject to controlled output variability under fixed provider/model/temperature settings\. The gender inference target remains non\-functional in the current implementation and is excluded from all quantitative results\.

## 1Introduction

Predicting user behaviour from web session logs is a long\-standing challenge in e\-commerce analytics\. Aggregate metrics such as bounce rate and page views capture surface\-level activity but conflate heterogeneous behavioural signals that carry different semantic weight for different inference tasks\. A user who browses twelve product pages with near\-zero bounce may be an analytical researcher, a price\-comparing brand loyalist, or a returning committed buyer—each requiring different downstream treatment\.

SemantiClean addresses this problem by decomposing session data into a library of semantically distinct behavioural elements, each capturing one narrowly scoped signal\. These elements are computed by a deterministic engine from OSPI session fields, then aggregated by pluggable inference targets that define their own label sets and signal weights\. The same element library simultaneously serves a design\-time Proposer/Reviewer pipeline that uses large language models to generate and quality\-gate new elements, ensuring semantic non\-redundancy at library construction time rather than at inference time\.

Cirqueiraet al\.\[[2](https://arxiv.org/html/2606.11207#bib.bib2)\]proposed a tripartite taxonomy distinguishing three e\-commerce purchase behaviour prediction tasks: customer intents, buying sessions, and purchase decisions\. These three tasks correspond directly to SemantiClean’spurchase\_intent,customer\_segment, andproduct\_affinityinference targets respectively, grounding the framework’s target design in an established research taxonomy\[[2](https://arxiv.org/html/2606.11207#bib.bib2)\]\.

SemantiClean departs from the dominant accuracy\-centric paradigm in e\-commerce analytics\. Rather than optimising end\-to\-end black\-box classifiers, this framework treats behavioural prediction as an auditable reasoning process\. By decoupling signal extraction \(deterministic element library\) from task\-specific aggregation \(pluggable targets\), the system prioritises structural transparency, conservative abstention over low\-confidence guesses, and explicit governance of signal inflation\. This design positions SemantiClean as an infrastructure for compliance\-sensitive applications where decision traceability outweighs marginal gains in raw predictive performance\.

The framework evolves across three major architectural releases:

1. Release 1:Prototype Architecture\(v1\.x\): eleven\-element library, four inference targets, Proposer/Reviewer agents with external prompt files\.
2. Release 2:Deterministic Core Engine: JSON\-driven architecture—all element definitions moved to a single source\-of\-truth library file; no hardcoded element logic\.
3. Release 3:LLM\-Integrated Semantic Inference Engine: Two\-phase LLM inference engine with on\-demand element loading, fully implemented and empirically evaluated in this report\.

#### Related Work\.

Prior OSPI studies predominantly rely on end\-to\-end machine learning classifiers trained directly on raw session features—includingSakaret al\.\[[11](https://arxiv.org/html/2606.11207#bib.bib10)\]’s real\-time LSTM benchmark,Gupta Alamuri and Bondalapu \[[4](https://arxiv.org/html/2606.11207#bib.bib4)\]’s SMOTE\-enhanced SVC \(ROC\-AUC = 0\.886, F1 = 0\.633\),Tokuç and Dag \[[12](https://arxiv.org/html/2606.11207#bib.bib11)\]’s hybrid clickstream representation,Wanget al\.\[[13](https://arxiv.org/html/2606.11207#bib.bib12)\]’s XGBoost multi\-feature fusion \(accuracy = 0\.9761, F1 = 0\.9763\), andZhou and Hudin \[[14](https://arxiv.org/html/2606.11207#bib.bib13)\]’s GNN\-enhanced deep learning approach\. In contrast, SemantiClean emphasises interpretable modular semantic elements—a library of narrowly scoped behavioural signals combined via pluggable inference targets rather than fed into black\-box models\.

On the LLM side,Chodaket al\.\[[1](https://arxiv.org/html/2606.11207#bib.bib1)\]demonstrated ChatGPT\-4o efficiency for e\-commerce log analysis while cautioning against hallucination risks; structured LLM architectures such as SPARK\_AI\[[8](https://arxiv.org/html/2606.11207#bib.bib7)\]and HCoT\[[6](https://arxiv.org/html/2606.11207#bib.bib6)\]show that prompt\-orchestrated multi\-phase workflows improve reasoning reliability\. SemantiClean bridges these threads through its dual\-engine architecture\.

## 2Dataset

SemantiClean operates on the Online Shoppers Purchasing Intention \(OSPI\) dataset\[UCI Machine Learning Repository, ID 468;[10](https://arxiv.org/html/2606.11207#bib.bib9)\], comprising 12,330 web sessions with 18 features and no missing values\. The dataset contains three feature groups\.

#### Page behaviour numerics\.

Administrative,Administrative Duration,Informational,Informational Duration,Product Related,Product Related Duration—page counts and dwell times per content type, used directly by Functional and Interaction layer elements\.

#### Google Analytics metrics\.

Bounce Rates\(bb\),Exit Rates\(ee\),Page Values\(PvP\_\{v\}\),Special Day\(Sd​a​yS\_\{day\}\)—engagement quality and promotional proximity signals\.

#### Contextual categoricals\.

Month,Operating Systems,Browser,Region,Traffic Type,Visitor Type,Weekend—environmental and traffic conditions for Contextual layer elements\.

The binary target labelRevenue\(purchase completion,≈\\approx15% positive rate\) is used solely for inference validation and does not participate in element computation\. Three fields absent from OSPI—query text, category detail, and gender—represent the primary data gaps addressed by the LLM supplement mechanism \(E8\) and the uncalibrated gender inference target respectively\.

#### Reproducibility note\.

σ=0\\sigma=0for all deterministic results\. E8 and E10 LLM results are subject to output variability; multi\-run mean and SD should be collected under controlled provider/model/temperature settings\.

## 3Element Library Architecture

### 3\.1Four\-Layer Organisation

The element library organises twenty\-four behavioural elements into four semantic layers executed in the following fixed order \(determined by the library metadata\):

Functional→Interaction→Systemic→Contextual\\text\{Functional\}\\rightarrow\\text\{Interaction\}\\rightarrow\\text\{Systemic\}\\rightarrow\\text\{Contextual\}\(1\)
TheFunctional layer\(E1–E4, E12–E16, E20\) computes directly measurable page behaviour metrics\. TheInteraction layer\(E5–E8, E17–E19, E21–E24\) captures decision patterns and intent signals\. TheSystemic layer\(E9, E19\) produces cross\-element composites depending on upstream outputs\. TheContextual layer\(E10–E11, E12, E14, E18\) applies environmental modifiers\. Layer membership is determined by the primary category tag of each element definition; each element’s full tag array spans≥\\geq2 distinct layers \(ReviewerAgent CHECK 3\)\.

### 3\.2JSON\-Driven Architecture

All element definitions, execution order, signal score mappings, and redundancy group parameters reside in a single element library file \(behavior\_elements\.json\), serving as the sole source of truth for both engines and the design\-time agents\. The deterministic engine reads execution order from the library metadata, dispatches element\-specific distillation functions by name via a function dispatch table, and derives signal score mappings from per\-element mapping specifications\. When a mapping specification is absent, a hardcoded fallback dictionary is applied\. Adding a new element requires only a library file entry; no algorithmic changes are needed\.

### 3\.3Element Reference

Table[1](https://arxiv.org/html/2606.11207#S3.T1)summarises the complete element inventory inbehavior\_elements\.json\. Elements E01–E11 constitute the core library; elements E12–E24 were added during library expansion to improve OSPI signal coverage\.

Table 1:Summary of core behavioural elements \(E01–E11\)\. See Appendix[C](https://arxiv.org/html/2606.11207#A3)for the complete 24\-element inventory including expanded elements\.

## 4Methodology

### 4\.1Derived Field Computation

Before element distillation, a set of derived fields is computed from raw OSPI fields by the derived\-field computation module\. Key quantities include total session durationDt​o​t​a​l=Da​d​m​i​n\+Di​n​f​o\+Dp​r​o​dD\_\{total\}=D\_\{admin\}\+D\_\{info\}\+D\_\{prod\}\(Eq\. 1\), total page countNt​o​t​a​lN\_\{total\}\(Eq\. 2\), and the time allocation ratiosrp​r​o​d=Dp​r​o​d/Dt​o​t​a​lr\_\{prod\}=D\_\{prod\}/D\_\{total\}andri​n​f​o=Di​n​f​o/Dt​o​t​a​lr\_\{info\}=D\_\{info\}/D\_\{total\}whenDt​o​t​a​l\>0D\_\{total\}\>0\(Eqs\. 3–4\)\. These ratios are used directly by E1 and E5 respectively\.

Sessions withDt​o​t​a​l<10D\_\{total\}<10seconds andNt​o​t​a​l=0N\_\{total\}=0trigger Fallback Rule 1\. The 10\-second threshold is a design constant without ablation support \.Gorman \[[3](https://arxiv.org/html/2606.11207#bib.bib3)\]provides empirical support for this design choice: in a multiple logistic regression study on OSPI, extremely short sessions are strongly associated with non\-purchase behaviour, with BounceRates, ExitRates, PageValues, and VisitorType all identified as significant predictors \(AUC = 0\.8969\)\. The Fallback Rule 1 threshold operationalises this empirical finding as a deterministic exclusion criterion\[[3](https://arxiv.org/html/2606.11207#bib.bib3)\]\.

### 4\.2Functional Layer Elements \(E1–E4, E12–E16, E20\)

The Functional layer elements compute directly observable page behaviour signals from OSPI numeric fields\. All computations are deterministic \(σ=0\\sigma=0\)\.

#### E1 – Product Engagement Depth\.

synthesises three complementary dimensions of product browsing behaviour into a single depth score:

sd​e​p​t​h=0\.40⋅rp​r​o​d\+0\.30⋅min⁡\(1,t¯p​r​o​d/120\)\+0\.30⋅min⁡\(1,Pv/50\)s\_\{depth\}=0\.40\\cdot r\_\{prod\}\+0\.30\\cdot\\min\(1,\\bar\{t\}\_\{prod\}/120\)\+0\.30\\cdot\\min\(1,P\_\{v\}/50\)\(2\)whererp​r​o​dr\_\{prod\}captures time allocation,t¯p​r​o​d/120\\bar\{t\}\_\{prod\}/120captures per\-page dwell depth \(120\-second normalisation ceiling\), andPv/50P\_\{v\}/50captures Google Analytics page value \(50\-unit ceiling\)\. Weighting coefficients\[0\.40,0\.30,0\.30\]\[0\.40,0\.30,0\.30\]are design constants\. The rationale for combining dwell time, page count, and GA page value into a single depth signal is supported byNecula \[[9](https://arxiv.org/html/2606.11207#bib.bib8)\], who demonstrated that dwell time on product pages, when combined with bounce rates, exit rates, and customer type, is a significant predictor of purchase decisions\[[9](https://arxiv.org/html/2606.11207#bib.bib8)\]\.

#### E2 – Bounce Exit Commitment\.

computes session commitment as the complement of the bounce\-exit composite:

sc​o​m​m​i​t=max⁡\(0,\[1−\(0\.5​b\+0\.5​e\)\]⋅\(0\.7\+0\.3⋅min⁡\(1,Nt​o​t​a​l/10\)\)−δt​r​a​f​f​i​c\)s\_\{commit\}=\\max\\left\(0,\[1\-\(0\.5b\+0\.5e\)\]\\cdot\(0\.7\+0\.3\\cdot\\min\(1,N\_\{total\}/10\)\)\-\\delta\_\{traffic\}\\right\)\(3\)whereδt​r​a​f​f​i​c=0\.10\\delta\_\{traffic\}=0\.10for paid search \(TrafficType = 2\) and referral traffic \(TrafficType = 4\) \.

#### E3 – Page Value Conversion Signal\.

applies imputation for sessions withPv=0P\_\{v\}=0but substantial product browsing:

sp​v=\{0\.15if​\(Pv=0∧Np​r​o​d\>3\)min⁡\(1,Pv/50\)otherwises\_\{pv\}=\\begin\{cases\}0\.15&\\text\{if \}\(P\_\{v\}=0\\land N\_\{prod\}\>3\)\\\\ \\min\(1,P\_\{v\}/50\)&\\text\{otherwise\}\\end\{cases\}\(4\)The imputed value 0\.15 reflects the design assumption that high\-browsing zero\-GA sessions may carry latent conversion intent, corroborated byGupta Alamuri and Bondalapu \[[4](https://arxiv.org/html/2606.11207#bib.bib4)\]’s feature analysis identifying product\-page engagement as a key behavioural predictor\.

#### E4 – Promotional Context Sensitivity\.

is one of two bias\-flagged elements \(†\\dagger\):

sp​r​o​m​o=0\.50⋅Sd​a​y\+0\.30⋅𝟙​\[peak month\]\+0\.20⋅𝟙​\[weekend\]s\_\{promo\}=0\.50\\cdot S\_\{day\}\+0\.30\\cdot\\mathbb\{1\}\[\\text\{peak month\}\]\+0\.20\\cdot\\mathbb\{1\}\[\\text\{weekend\}\]\(5\)Peak months: November, December, February, May\. A highsp​r​o​m​os\_\{promo\}indicates that observed purchasing behaviour may be driven by promotional pressure rather than genuine preference\.

### 4\.3Interaction Layer Elements \(E5–E8, E17–E19, E21–E24\)

The Interaction layer captures decision patterns, traffic intent, visitor loyalty, and LLM\-supplemented semantic signals\. E5–E7 are fully deterministic \(σ=0\\sigma=0\); E8 and E10 introduce LLM calls at inference time\.

#### E5 – Research Decision Style\.

computes a research intensity score:

sr​e​s​e​a​r​c​h=0\.35⋅ri​n​f​o\+0\.30⋅\(1−b\)\+0\.35⋅min⁡\(1,Np​r​o​d/8\)s\_\{research\}=0\.35\\cdot r\_\{info\}\+0\.30\\cdot\(1\-b\)\+0\.35\\cdot\\min\(1,N\_\{prod\}/8\)\(6\)Sessions are classified into decision styles: analytical \(sr​e​s​e​a​r​c​h\>0\.55s\_\{research\}\>0\.55\), moderate \(0\.250\.25–0\.550\.55\), impulsive \(≤0\.25\\leq 0\.25\)\.

#### E6 – Traffic Source Intent Score\.

maps traffic type codes to pre\-defined base intent scores via a lookup table , informed byHendriksenet al\.\[[5](https://arxiv.org/html/2606.11207#bib.bib5)\]’s demonstration that channel type is informative for anonymous session prediction\.

Table 2:Traffic Source Intent Score lookup table\. Traffic type codes 7–20 fall back to default score 0\.40 \.Returning visitors receive a loyalty bonus of \+0\.15 \(capped at 1\.0\), a design constant \.

#### E7 – Visitor Loyalty Commitment\.

returns a discrete loyalty score from a lookup structure\.

Table 3:Visitor Loyalty Commitment lookup structure\. Boundary condition : both conditions for New Visitor yieldsl​o​y​a​l​t​y=0\.55s\_\{loyalty\}=0\.55\.
#### E8 – Search Intent Semantic Inference\.

introduces an LLM zero\-shot call within the inference engine, activated only for search traffic sessions \(Traffic Type∈\{2,3\}\\in\\\{2,3\\\}\)\. The use of zero\-shot LLM inference for semantic search intent aligns withChodaket al\.\[[1](https://arxiv.org/html/2606.11207#bib.bib1)\], who empirically evaluated ChatGPT\-4o on e\-commerce server logs while cautioning that precise prompt formulation is necessary and hallucination risk must be managed\. SemantiClean’s LLMExecutionGuard and structured output requirements for E8 directly address these cautions\[[1](https://arxiv.org/html/2606.11207#bib.bib1)\]\.

### 4\.4Systemic and Contextual Layer Elements \(E9–E11, E12–E24\)

#### E9 – Session Value Composite Index\.

aggregates five upstream element signals into a single session\-level composite:

sc​o​m​p​o​s​i​t​e=∑i∈Uwi⋅vi,U=\{E1, E2, E3, E7, E6\},∑wi=1\.0s\_\{composite\}=\\sum\_\{i\\in U\}w\_\{i\}\\cdot v\_\{i\},\\quad U=\\\{\\text\{E1, E2, E3, E7, E6\}\\\},\\quad\\sum w\_\{i\}=1\.0\(7\)
Table 4:E9 upstream element weights\. Critical boundary : composite is not renormalised after zero upstream inputs\.Critical boundary : The composite is not renormalised after zero upstream inputs\. When three or more upstream values are zero \(z≥3z\\geq 3\), the degradation flag triggers and confidence drops to 0\.40\.

#### E10 – Device Ecosystem Pattern\.

\(bias\-flagged†\\dagger\) adjusts session duration for mobile device input constraints:

sd​e​v​i​c​e=min⁡\(1\.0,Dt​o​t​a​l/\(αm​o​b​i​l​e⋅300\)\),αm​o​b​i​l​e=0\.65​for mobile OSs\_\{device\}=\\min\\left\(1\.0,D\_\{total\}/\(\\alpha\_\{mobile\}\\cdot 300\)\\right\),\\quad\\alpha\_\{mobile\}=0\.65\\text\{ for mobile OS\}\(8\)

#### E11 – Temporal Context Signal\.

synthesises promotional proximity, seasonal timing, and day\-of\-week into a temporal pressure score:

st​e​m​p​o​r​a​l=0\.50⋅Sd​a​y\+0\.30⋅𝟙​\[peak month\]\+0\.20⋅fw​d​a​y,fw​d​a​y=\{0\.6weekend1\.0weekdays\_\{temporal\}=0\.50\\cdot S\_\{day\}\+0\.30\\cdot\\mathbb\{1\}\[\\text\{peak month\}\]\+0\.20\\cdot f\_\{wday\},\\quad f\_\{wday\}=\\begin\{cases\}0\.6&\\text\{weekend\}\\\\ 1\.0&\\text\{weekday\}\\end\{cases\}\(9\)Semantic boundary :fw​d​a​yf\_\{wday\}assigns higherst​e​m​p​o​r​a​ls\_\{temporal\}to purposeful weekday shopping—opposite to E4’s weekend direction\.

### 4\.5Three\-Layer Anti\-Inflation Mechanism

All inference targets share a common scoring pipeline that enforces three sequential quality mechanisms:

#### AdaptiveConstraintMode\.

dynamically determines constraint strictness based on the number of elements that pass their quality threshold:

Thresholds\[5,8\]\[5,8\]are design constants \.

#### RedundancyGroup caps\.

accumulate each element’s contribution toward its group ceilingCgC\_\{g\}in execution order:

#### TieredPenaltyCalculator\.

penalises bias\-flagged elements \(E4, E10\) based on signal divergenceΔ\\Deltafrom cross\-layer supporting signals \.

#### Final normalised label score:

s^ℓ=∑r\(σr,ℓ⋅\|wr,ℓ\|⋅πe​f​f,r⋅cr\)∑r\(\|wr,ℓ\|⋅cr\)\\hat\{s\}\_\{\\ell\}=\\frac\{\\sum\_\{r\}\(\\sigma\_\{r,\\ell\}\\cdot\|w\_\{r,\\ell\}\|\\cdot\\pi\_\{eff,r\}\\cdot c\_\{r\}\)\}\{\\sum\_\{r\}\(\|w\_\{r,\\ell\}\|\\cdot c\_\{r\}\)\}\(10\)As noted in §[4\.2](https://arxiv.org/html/2606.11207#S4.SS2): all signal weights enter Eq\.[10](https://arxiv.org/html/2606.11207#S4.E10)as absolute values\. Negative weights contribute positively to their assigned labels in identical fashion to positive weights of the same magnitude\.

### 4\.6LLM\-Integrated Two\-Phase Engine – Release 3 Implementation

TheLLM\-Integrated Semantic Inference Engineis fully implemented and empirically evaluated in this report\. It employs a three\-phase architecture:

#### Phase 1 \(Element Selection\)\.

The LLM receives a compact element summary index containing only element names, descriptions, and category tags \(∼\\sim3–5 KB\), enabling the model to select 3–9 relevant elements without loading the full library\. This lightweight element summary index design aligns with the self\-describing structured data paradigm proposed byLiu \[[7](https://arxiv.org/html/2606.11207#bib.bib14)\], where each element’s summary \(\_summary\) functions as a lightweight retrieval key that guides the LLM’s Phase 1 selection\[[7](https://arxiv.org/html/2606.11207#bib.bib14)\]\.

#### Phase 2 \(Deep Semantic Analysis\)\.

The LLM receives complete definitions for selected elements, executing formulas step\-by\-step, evaluating constraint conditions, selecting applicable variant formulae, and producing structured output including intermediate computation values, FBS reasoning, constraint trigger status, and failure mode risk level\.

#### Phase 3 \(Python Aggregation\)\.

Converts LLM output to element result objects and applies the same redundancy caps and TieredPenaltyCalculator used by the deterministic engine, ensuring scoring consistency between the two engines\.

Table 5:Token budget comparison \(architectural estimates\)\.

### 4\.7Empirical Validation Protocol: Masked\-Field Inference Experiment \(Exp\-A\)

To empirically evaluate the LLM\-Integrated Semantic Inference Engine, we conducted a masked\-field inference study\. The experiment deliberately removes the high\-informationRevenuecolumn from each session and tasks the LLM engine with predictingpurchase\_intentsolely from behavioral signals\.

#### Dataset & Sampling\.

We drew a stratified sample ofn=50n=50sessions from the OSPI dataset \(12,330 total\), preserving the natural class distribution \(Revenue=True: 16%, False: 84%\)\. Due to LLM API quota exhaustion during execution, 11 sessions were conservatively output asuncertainby the engine and excluded from accuracy computation, yieldingn=39n=39evaluated predictions for this pilot\.

#### Masking Strategy\.

TheRevenuefield is completely stripped from the session dictionary prior to inference\. A\_\_masked\_fields\_\_metadata tag is injected into the LLM prompt to explicitly signal the missing ground\-truth indicator\.

#### Engine Configuration\.

The inference pipeline follows the three\-phase architecture described in §[4\.6](https://arxiv.org/html/2606.11207#S4.SS6)\. The experiment used the Qwen3\-max model \(qwen3\-max\-2026\-01\-23\) withmax\_tokens=4096\(Phase 1\) /8192\(Phase 2\), temperature∈\[0\.0,0\.3\]\\in\[0\.0,0\.3\], and heuristic JSON truncation repair\.

#### Element Library State\.

The pilot operated onbehavior\_elements\.json, an expanded library containing 24 behavioral elements\. Each element is structured with: a deterministiccomputationformula, a three\-partconstraint, contextualvariants,failure\_history,fbs\_mapping,min\_confidencethresholds, andredundancy\_group\_id\.

## 5Results

### 5\.1Statistical Validation Framework

This study applies a validation framework comprising two dimensions:structural consistency\(verifying the pipeline behaves as specified\) andsignal plausibility\(verifying element outputs fall within expected ranges\)\. No inferential statistical tests are reported, as the current implementation does not execute hypothesis tests programmatically \.

### 5\.2Pass/Fail Standard Summary

Table[6](https://arxiv.org/html/2606.11207#S5.T6)summarises the system’s built\-in diagnostic criteria\.

Table 6:Built\-in diagnostic criteria summary\.
### 5\.3Element Signal Properties

All deterministic element results \(E1–E7, E9–E24 excluding E8/E10\) are fully reproducible given identical session input and element library version \(σ=0\\sigma=0\)\. E8 and E10 results are subject to LLM output variability when temperature\>0\>0; single\-run values should be accompanied by the caveat that multi\-run statistics must be collected under controlled provider/model/temperature conditions\.

#### Confidence value system \.

The effective confidence range is approximately\[0\.25,0\.65\]\[0\.25,0\.65\], not the theoretical\[0,1\]\[0,1\]\. Caps applied: data quality warning→0\.35\\rightarrow 0\.35; E9 degradation→0\.40\\rightarrow 0\.40; E8/E10 LLM success→min⁡\(cm​i​n,0\.65\)\\rightarrow\\min\(c\_\{min\},0\.65\); LLM failure→0\.25\\rightarrow 0\.25\.

### 5\.4Pilot Results: Revenue\-Masked Purchase Intent Inference

Table[7](https://arxiv.org/html/2606.11207#S5.T7)summarises the performance of the LLM engine when predictingpurchase\_intentwithout access to theRevenuefield\.

Table 7:Masked\-field purchase intent inference performance \(n=39n=39evaluated\)\.This performance profile is not an optimisation failure but a structural consequence of the framework’s conservative abstention policy\. In the absence of ground\-truth revenue signals, the element library correctly identifies high\-engagement sessions as necessary but insufficient for purchase intent\. The 22% uncertain output rate and the bimodal confidence distribution \(§[5\.5](https://arxiv.org/html/2606.11207#S5.SS5)\) empirically validate the system’s preference for withholding low\-confidence predictions rather than fabricating certainty—a design imperative for audit\-ready systems\.

#### Confusion Matrix \(n=39n=39\)\.

TP=5, FP=14, TN=17, FN=3\. The system exhibits a strong tendency to predictpurchasewhen behavioral signals appear active, resulting in 14 false positives\.

#### Uncertain Output Analysis\.

All 11uncertaincases had confidence scores<0\.25<0\.25\. The dominant decision reason wasuncertain\_zone\(10/11\), triggered when key element scores fell near threshold boundaries\. This confirms that uncertainty is structurally induced by the element library’s conservative thresholds, not by random LLM failure\.

### 5\.5Two\-Regime Confidence Analysis and Error Pattern Decomposition

A detailed inspection of the 39 evaluated predictions reveals a striking two\-regime confidence pattern\. Rather than a continuous confidence distribution, predictions cluster into two distinct bands: a low\-to\-moderate regime \(confidence 0\.25–0\.72\) associated exclusively with purchase predictions, and a high\-certainty regime \(confidence = 1\.00\) associated exclusively with no\_purchase predictions\.

This bimodal structure arises directly from the scoring architecture\. The purchase label requires positive accumulation of engagement signals across multiple elements, producing fractional confidence values sensitive to signal strength\. In contrast, the no\_purchase prediction is issued when all engagement signals fall below threshold simultaneously, producing a near\-zero numerator and effectively a maximum confidence assignment\. This is a structural property of the absolute\-value scoring formula \(Eq\.[10](https://arxiv.org/html/2606.11207#S4.E10)\), not a calibrated probabilistic confidence\.

Table 8:Confidence band analysis \(n=39n=39predictions\)\.The practical implication is that the system functions as a conservative no\_purchase detector at high confidence \(85% precision\) while producing unreliable purchase predictions across all confidence levels\. The 14 false positives occur predominantly because the element library—in the absence of the Revenue field—cannot distinguish between engaged browsing\-without\-purchase and engaged browsing\-with\-purchase\.

## 6Limitations

### 6\.1Experimental Design Limitations

- Traffic type coverage gap:The intent score lookup table covers traffic type codes 1–6 only\. Codes 7–20 fall back to a default score of 0\.40\.
- PageValues = 0 session proportion:The imputation logic in E3 activates forPv=0P\_\{v\}=0andNp​r​o​d\>3N\_\{prod\}\>3\. The imputation frequency is not reported\.
- Visitor type imbalance:OSPI contains approximately 85% Returning Visitors\. The Visitor Loyalty element \(E7\) may systematically dominate the GRP\_USER\_IDENTITY group quota\.
- Revenue class imbalance:Purchase\-positive sessions constitute approximately 15% of OSPI\.

### 6\.2Pilot Study Constraints

The masked\-field validation \(Exp\-A\) represents a preliminary pilot with three acknowledged constraints:

1. \(1\)Sample size:API quota exhaustion limited evaluated predictions ton=39n=39\. Wider confidence intervals \(Wilson 95% CI for Accuracy: \[40\.1%, 71\.8%\]\) indicate the need forn≥500n\\geq 500in subsequent validation\.
2. \(2\)Confidence\-accuracy decoupling:The current confidence aggregation formula does not calibrate against ground\-truth error rates\.
3. \(3\)Single\-model evaluation:All results used Qwen3\-max\. Cross\-provider robustness and temperature sensitivity remain untested\.

### 6\.3Reproducibility Boundary

Table 9:Reproducibility boundary for result items\.
### 6\.4Design Constant Declarations

The following parameters are design constants without ablation experimental support\. Their optimal values await systematic search \.

1. \(R1\)E1 weighting coefficients\[0\.40,0\.30,0\.30\]\[0\.40,0\.30,0\.30\]— balance among time allocation, per\-page dwell, and page value dimensions\.
2. \(R2\)PageValues normalisation ceiling 50 — upper bound forPvP\_\{v\}normalisation in E1 and E3\.
3. \(R3\)Average product time normalisation ceiling 120 seconds — assumed upper bound for meaningful per\-page dwell time\.
4. \(R4\)Research depth data quality threshold 10 seconds and classification thresholds\[0\.25,0\.55\]\[0\.25,0\.55\]\.
5. \(R5\)Bounce exit traffic correctionδt​r​a​f​f​i​c=0\.10\\delta\_\{traffic\}=0\.10for paid search and referral traffic\.
6. \(R6\)Traffic type base intent scores\{1:0\.80,2:0\.50,3:0\.60,4:0\.45,5:0\.35,6:0\.70\}\\\{1:0\.80,2:0\.50,3:0\.60,4:0\.45,5:0\.35,6:0\.70\\\}and returning visitor loyalty bonus \+0\.15\.
7. \(R7\)PageValues zero\-imputation value 0\.15 and trigger thresholdNp​r​o​d\>3N\_\{prod\}\>3\.
8. \(R8\)All signal weights for all inference targets\.
9. \(R9\)AdaptiveConstraintMode thresholds\[5,8\]\[5,8\]and RedundancyGroup caps\{0\.35,0\.30,0\.30,0\.20\}\\\{0\.35,0\.30,0\.30,0\.20\\\}\.
10. \(R10\)TieredPenaltyCalculator divergence thresholds\[0\.15,0\.35\]\[0\.15,0\.35\]and element\-specific base penalty multipliersπ0\\pi\_\{0\}\.

For methodological context:Wanget al\.\[[13](https://arxiv.org/html/2606.11207#bib.bib12)\]achieved accuracy = 0\.9761 and F1 = 0\.9763 on OSPI using XGBoost with a multi\-feature fusion approach—a black\-box gradient boosting method trained end\-to\-end on raw features\[[13](https://arxiv.org/html/2606.11207#bib.bib12)\]\. SemantiClean’s deterministic engine produces fully reproducible results \(σ=0\\sigma=0\) without supervised training, at the cost of lower raw accuracy, in exchange for interpretable, auditable element\-level explanations\.

Zhou and Hudin \[[14](https://arxiv.org/html/2606.11207#bib.bib13)\]advance purchase prediction further using time\-series attention mechanisms with event\-based timestamp encoding and Graph Neural Network\-enhanced user profiling\[[14](https://arxiv.org/html/2606.11207#bib.bib13)\]\. SemantiClean takes a complementary direction: a rule\-based engine \(σ=0\\sigma=0\) prioritising structured reasoning and human oversight over end\-to\-end optimisation\.

Future work could address the ablation gap for design constants \(R1–R10\) by adopting principles from HCoT\[[6](https://arxiv.org/html/2606.11207#bib.bib6)\], which integrates expert\-system heuristics into LLM chain\-of\-thought reasoning to achieve Pareto\-optimal trade\-offs between performance and token efficiency\[[6](https://arxiv.org/html/2606.11207#bib.bib6)\]\.

### 6\.5Future Work: Neuro\-Symbolic \+ Constrained RL Architecture

Building on the structured heuristic principles of HCoT\[[6](https://arxiv.org/html/2606.11207#bib.bib6)\], future work will extend this optimisation pathway through a Neuro\-Symbolic \+ Constrained Reinforcement Learning \(RL\) architecture\. SemantiClean and RL occupy fundamentally different positions on the decision\-making spectrum: the former operates as a modernised expert system prioritising semantic symbolic reasoning and structured governance, while the latter focuses on data\-driven adaptive learning and closed\-loop reward maximisation\. Their intersection is limited to state abstraction, constraint handling, and static policy simulation, rather than online learning mechanisms\. To preserve the framework’s core transparency guarantees, online RL is explicitly excluded\. Instead, all learning will be strictly confined to offline or design\-time phases, ensuring that runtime inference remains fully deterministic \(σ=0\\sigma=0\)\. This hybrid pipeline will target four key objectives:

1. \(1\)Offline optimisation of design constants \(R1–R10\) via Bayesian optimisation or PPO, treating element weights and thresholds as an action space guided by an Auditability–Accuracy Pareto Score\. Optimal parameters will be committed statically to behavior\_elements\.json, systematically closing the ablation gap without compromising reproducibility\.
2. \(2\)Dynamic Redundancy Group Caps using Safe RL agents to adjust group ceilings \(CgC\_\{g\}\) based on session context, with hard safety constraints enforced to prevent signal monopolisation—directly addressing the GRP\_USER\_IDENTITY saturation documented in §[5\.5](https://arxiv.org/html/2606.11207#S5.SS5)\.
3. \(3\)LLM\-as\-Reward\-Model calibration, where the LLM generates fine\-grained reward signals from element outputs and historical failure modes to train a lightweight value network, enabling probabilistic calibration \(e\.g\., Platt scaling or isotonic regression\) exclusively within the uncertain\_zone\.
4. \(4\)Strict learning–inference separation, guaranteeing that all policy updates remain offline while the deterministic engine and structured LLM routing govern all production predictions\. This approach maintains auditability as the primary invariant while systematically exploring the accuracy–interpretability Pareto frontier\.

## 7Conclusion

We have presented SemantiClean, a modular semantic behavioral inference framework that prioritises auditability, structural governance, andσ=0\\sigma=0reproducibility over marginal predictive gains\. By organising twenty\-four behavioural elements into a four\-layer architecture and enforcing signal quality through three anti\-inflation mechanisms, the framework provides defensible decision trails for compliance\-sensitive e\-commerce applications\.

The fully implemented LLM\-Integrated Semantic Inference Engine demonstrates that two\-phase LLM\-driven inference—combining lightweight element routing with deep semantic analysis—can leverage structured behavioural knowledge while maintaining scoring consistency with deterministic baselines\. Pilot results on masked\-field purchase intent inference validate the system’s conservative abstention policy: when ground\-truth revenue signals are unavailable, the framework correctly withholds low\-confidence predictions rather than fabricating certainty\.

Future work will address the ablation gap for design constants through an LLM\-Guided Constrained Search framework, extending optimisation through a Neuro\-Symbolic \+ Constrained Reinforcement Learning architecture while preserving the framework’s core transparency guarantees\.

## References

- \[1\]G\. Chodak, G\. Suchacka, and S\. Rovetta\(2025\)Large language models for analyzing e\-commerce web server logs\.InProceedings of the 39th ECMS International Conference on Modelling and Simulation \(ECMS 2025\),M\. Scarpa, S\. Cavalieri, S\. Serrano, and F\. De Vita \(Eds\.\),Catania, Italy,pp\. 593–603\.External Links:[Document](https://dx.doi.org/10.7148/2025-0593)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p2.1),[§4\.3](https://arxiv.org/html/2606.11207#S4.SS3.SSS0.Px4.p1.1)\.
- \[2\]D\. Cirqueira, M\. Hofer, D\. Nedbal, M\. Helfert, and M\. Bezbradica\(2020\)Customer purchase behavior prediction in e\-commerce: a conceptual framework and research agenda\.InNew Frontiers in Mining Complex Patterns \(NFMCP 2019\),Lecture Notes in Computer Science, Vol\.11948,pp\. 119–136\.Cited by:[§1](https://arxiv.org/html/2606.11207#S1.p3.1)\.
- \[3\]R\. Gorman\(2025\)An exploration of e\-commerce purchases with multiple logistic regression\.Note:RStudio CapstoneExternal Links:[Link](https://rstudio-pubs-static.s3.amazonaws.com/1359556_4d08a34b016a47c599fe37562129fa7b.html)Cited by:[§4\.1](https://arxiv.org/html/2606.11207#S4.SS1.p2.2)\.
- \[4\]O\. R\. S\. Gupta Alamuri and C\. K\. Bondalapu\(2025\)Predicting e\-commerce purchase intention using machine learning\.ASEAN Journal of Scientific and Technological Reports4\(1\),pp\. 42–58\.External Links:[Link](https://ph02.tci-thaijo.org/index.php/tsujournal/article/view/260159)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p1.1),[§4\.2](https://arxiv.org/html/2606.11207#S4.SS2.SSS0.Px3.p1.2)\.
- \[5\]M\. Hendriksen, E\. Kuiper, P\. Nauts, S\. Schelter, and M\. de Rijke\(2020\)Analyzing and predicting purchase intent in e\-commerce: anonymous vs\. identified customers\.InSIGIR eCommerce 2020 Workshop,External Links:2012\.08777,[Document](https://dx.doi.org/10.48550/arXiv.2012.08777)Cited by:[§4\.3](https://arxiv.org/html/2606.11207#S4.SS3.SSS0.Px2.p1.1)\.
- \[6\]L\. Linet al\.\(2026\)Heuristic classification of thoughts prompting \(hcot\): integrating expert system heuristics for structured reasoning into large language models\.arXiv preprintarXiv:2604\.12390\.External Links:[Link](https://arxiv.org/abs/2604.12390)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p2.1),[§6\.4](https://arxiv.org/html/2606.11207#S6.SS4.p5.1),[§6\.5](https://arxiv.org/html/2606.11207#S6.SS5.p1.1)\.
- \[7\]H\. M\. Liu\(2026\)Self\-describing structured data with dual\-layer guidance: a lightweight alternative to rag for precision retrieval in large\-scale llm knowledge navigation\.Technical reportZenodo\.Note:Accessed via DOIExternal Links:[Document](https://dx.doi.org/10.5281/zenodo.19575355),[Link](https://doi.org/10.5281/zenodo.19575355)Cited by:[§4\.6](https://arxiv.org/html/2606.11207#S4.SS6.SSS0.Px1.p1.1)\.
- \[8\]M\. Marićet al\.\(2026\)SPARK\_AI: a prompt\-orchestrated architecture for stateful, process\-oriented reasoning with large language models\.Informatics13\(4\),pp\. 63\.External Links:[Document](https://dx.doi.org/10.3390/informatics13040063)Cited by:[§D\.2](https://arxiv.org/html/2606.11207#A4.SS2.p1.1),[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p2.1)\.
- \[9\]S\. Necula\(2023\)Exploring the impact of time spent reading product information on e\-commerce websites: a machine learning approach to analyze consumer behavior\.Behavioral Sciences13\(6\),pp\. 439\.External Links:[Document](https://dx.doi.org/10.3390/bs13060439)Cited by:[§4\.2](https://arxiv.org/html/2606.11207#S4.SS2.SSS0.Px1.p1.4)\.
- \[10\]C\. O\. Sakar, S\. O\. Polat, M\. Katırcıoğlu, and Y\. Kastro\(2018\)Online shoppers purchasing intention dataset\.Note:UCI Machine Learning RepositoryExternal Links:[Document](https://dx.doi.org/10.24432/C5F88Q)Cited by:[§2](https://arxiv.org/html/2606.11207#S2.p1.1)\.
- \[11\]C\. O\. Sakar, S\. O\. Polat, M\. Katırcıoğlu, and Y\. Kastro\(2019\)Real\-time prediction of online shoppers‘ purchasing intention using multilayer perceptron and lstm recurrent neural networks\.Neural Computing and Applications31\(10\),pp\. 6893–6908\.External Links:[Document](https://dx.doi.org/10.1007/s00521-018-3523-0)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p1.1)\.
- \[12\]A\. A\. Tokuç and T\. Dag\(2025\)Predicting user purchases from clickstream data: a comparative analysis of clickstream data representations and machine learning models\.IEEE Access13,pp\. 45421–45436\.External Links:[Document](https://dx.doi.org/10.1109/ACCESS.2025.3548267)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p1.1)\.
- \[13\]W\. Wang, W\. Xiong, J\. Wang, L\. Tao, S\. Li, Y\. Yi, X\. Zou, and C\. Li\(2023\)A user purchase behavior prediction method based on xgboost\.Electronics12\(9\),pp\. 2047\.External Links:[Document](https://dx.doi.org/10.3390/electronics12092047)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p1.1),[§6\.4](https://arxiv.org/html/2606.11207#S6.SS4.p3.1)\.
- \[14\]S\. Zhou and N\. S\. Hudin\(2024\)Advancing e\-commerce user purchase prediction: integration of time\-series attention with event\-based timestamp encoding and graph neural network\-enhanced user profiling\.PLOS ONE19\(4\),pp\. e0299087\.External Links:[Document](https://dx.doi.org/10.1371/journal.pone.0299087)Cited by:[§1](https://arxiv.org/html/2606.11207#S1.SS0.SSS0.Px1.p1.1),[§6\.4](https://arxiv.org/html/2606.11207#S6.SS4.p4.1)\.

## Appendix APhase 0 Audit Register Summary

This appendix records key findings from the adversarial audit \(Phase 0\)\. All items are referenced in the methodology and limitations sections above\.

## Appendix BElement Definition – E1 Product\_Engagement\_Depth

This appendix presents the complete JSON definition of E1 \(Product\_Engagement\_Depth\) as it appears inbehavior\_elements\.json\. E1 is selected as the reference example because it is fully deterministic \(no LLM fallback\), has no bias flag, and participates in the primary inference target \(purchase\_intent\) with the second\-highest signal weight\.

```
{
 "element_name": "Product_Engagement_Depth",
 "description": "Product page engagement depth: composite of page
 count, dwell time, and GA page value, reflecting genuine
 user interest intensity in product content.",
 "category_tags": ["PRODUCT_ENGAGEMENT", "SESSION_COMPOSITE"],
 "semantic_domain": "Consumer_Behavior",
 "computation": {
 "formula": "product_focus_ratio = ProductRelated_Duration /
 total_duration if total_duration > 0 else 0
 avg_product_time = ProductRelated_Duration / ProductRelated
 if ProductRelated > 0 else 0
 pv_norm = min(1.0, PageValues / 50)
 depth_score = 0.40 * product_focus_ratio
 + 0.30 * min(1.0, avg_product_time / 120)
 + 0.30 * pv_norm
 if ProductRelated == 0 or ProductRelated_Duration == 0:
 depth_score = 0.0",
 "required_fields": [
 "ProductRelated", "ProductRelated_Duration", "PageValues"
 ],
 "derived_fields": ["total_duration", "product_focus_ratio"],
 "llm_fallback": null
 },
 "constraint": {
 "CONDITION": "If ProductRelated == 0 or ProductRelated_Duration
 == 0: depth_score = 0.0, signal = no_product_interest.
 If SpecialDay > 0.5: attach promo_context_warning = True.",
 "FAILURE_MODE": "During promotional periods (SpecialDay > 0.5),
 PageValues inflates due to mass traffic to high-value GA
 pages, causing depth_score to overestimate genuine product
 interest by ~25-40%, producing systematic false positives
 in purchase_intent during promotional months.",
 "VERIFICATION_TEST": "On SpecialDay==0 sessions: proportion
 of Revenue=True where depth_score > 0.5 must exceed 30%
 (baseline ~15%); Spearman(depth_score, Revenue) > 0.30;
 AUC > 0.65."
 },
 "fbs_mapping": {
 "F": "Quantify active user engagement with product content,
 distinguishing genuine interest from passive browsing.",
 "B": "Dwell time + page count + GA value form a composite
 engagement signal.",
 "S": "Weighted combination of ProductRelated / ProductRelated
 _Duration / PageValues columns."
 },
 "variants": [
 {
 "variant_name": "Duration-Heavy",
 "formula_variant": "depth_score = 0.60 * product_focus_ratio
 + 0.40 * pv_norm",
 "applicable_condition": "ProductRelated < 3 but high per-page
 dwell time (avg_product_time > 150s)"
 }
 ],
 "bias_risk_flag": false,
 "bias_reason": "",
 "min_confidence": 0.65,
 "output_key": "product_engagement_depth",
 "redundancy_group_id": "GRP_PAGE_ENGAGEMENT",
 "conflict_penalty_multiplier": 0.5,
 "required_supporting_layers": [],
 "failure_history": [
 {
 "scenario": "Black Friday",
 "failure_mode": "PageValues spike inflates depth_score",
 "lesson": "Attach promo_context_warning when SpecialDay > 0.5"
 }
 ],
 "_llm_instructions": {
 "category_retrieval_logic": "Retrieve when context involves
 product page dwell time, multi-product engagement patterns,
 or high-investment browsing signals.",
 "execution_phase": "Phase Functional  compute first.",
 "redundancy_note": "Member of GRP_PAGE_ENGAGEMENT (cap: 35%).
 Skip if group contribution already at cap.",
 "llm_supplement": "Fully deterministic  no LLM call required.",
 "bias_handling": "No bias risk flag. Standard scoring applies.",
 "constraint_template": "CONSTRAINT:\n[CONDITION] ...\n
 [FAILURE_MODE] ...\n[VERIFICATION_TEST] ..."
 }
}
```

## Appendix CComplete Element Library Inventory – behavior\_elements\.json

The following table lists all 24 behavioural elements in the current library\. Elements E01–E11 constitute the core library validated in the deterministic engine \(§[3\.3](https://arxiv.org/html/2606.11207#S3.SS3)\)\. Elements E12–E24 were added during library expansion to improve OSPI signal coverage; these elements participate in the LLM engine’s Phase 1 routing but are not used by the deterministic engine’s hardcoded dispatch table\. All 24 elements are fully structured with computation formula, three\-part constraint, FBS mapping, failure history, and\_llm\_instructionsfields\. None of the 24 elements currently has a second variant \(variants = 1for all\), representing a known coverage gap for edge\-case adaptation\.

Table 10:Complete element library inventory \(24 elements\)\.†\\dagger= bias\_risk\_flag=True; \(LLM\) = llm\_fallback active\.\#Element NameLayerRedundancy GroupBiasmin\_confStatusE01Product\_Engagement\_DepthFunc\.GRP\_PAGE\_ENGAGEMENT—0\.65CoreE02Bounce\_Exit\_CommitmentFunc\.GRP\_SESSION\_QUALITY—0\.60CoreE03Page\_Value\_Conversion\_SignalFunc\.GRP\_PAGE\_ENGAGEMENT—0\.70CoreE04Promotional\_Context\_SensitivityFunc\.GRP\_CONTEXT\_MODIFIERS†\\dagger0\.60CoreE05Research\_Decision\_StyleInter\.GRP\_USER\_IDENTITY—0\.60CoreE06Traffic\_Source\_Intent\_ScoreInter\.GRP\_USER\_IDENTITY—0\.65CoreE07Visitor\_Loyalty\_CommitmentInter\.GRP\_USER\_IDENTITY—0\.70CoreE08Search\_Intent\_Semantic\_InferenceInter\.GRP\_USER\_IDENTITY\(LLM\)0\.45CoreE09Session\_Value\_Composite\_IndexSyst\.GRP\_SESSION\_QUALITY—0\.60CoreE10Device\_Ecosystem\_PatternCont\.GRP\_CONTEXT\_MODIFIERS†\\dagger\(LLM\)0\.55CoreE11Temporal\_Context\_SignalCont\.GRP\_CONTEXT\_MODIFIERS—0\.60CoreE12Promo\_Context\_Page\_Value\_DriftFunc\.GRP\_CONTEXT\_MODIFIERS—0\.60Exp\.E13Value\_Signal\_Stability\_IndexFunc\.GRP\_SESSION\_QUALITY—0\.65Exp\.E14Exit\_Rate\_Promo\_Context\_Modulated\_IndexFunc\.GRP\_CONTEXT\_MODIFIERS—0\.62Exp\.E15Bounce\_Rate\_Traffic\_Intent\_FilterFunc\.GRP\_SESSION\_QUALITY—0\.62Exp\.E16Product\_Page\_Engagement\_IntensityFunc\.GRP\_PAGE\_ENGAGEMENT—0\.65Exp\.E17Device\_Ecosystem\_Complexity\_IndexCont\.GRP\_USER\_IDENTITY—0\.62Exp\.E18Promo\_Context\_Search\_DriftInter\.GRP\_CONTEXT\_MODIFIERS—0\.60Exp\.E19Promo\_Contextual\_Loyalty\_IndexSyst\.GRP\_USER\_IDENTITY—0\.60Exp\.E20Promo\_Duration\_Compression\_IndexFunc\.GRP\_SESSION\_QUALITY—0\.62Exp\.E21Research\_Depth\_From\_Page\_DiversityInter\.GRP\_SESSION\_QUALITY—0\.62Exp\.E22Decision\_Delay\_From\_Engagement\_TimingInter\.GRP\_SESSION\_QUALITY—0\.60Exp\.E23Cross\_Device\_Research\_SpanInter\.GRP\_USER\_IDENTITY—0\.58Exp\.E24Cross\_Device\_Traffic\_Intent\_PriorInter\.GRP\_USER\_IDENTITY—0\.60Exp\.Table 10:Complete element library inventory \(continued\)\.### C\.1Redundancy Group Membership and Cap Configuration

The four redundancy groups define the anti\-inflation architecture\. Group caps are read from the library metadata fieldvalid\_redundancy\_groupsat runtime\. The core 11\-element execution order \(E01→\\rightarrowE11\) is also read from library metadata, ensuring that E09 \(Systemic layer, depends on five upstream outputs\) is always computed last among the core elements\.

Table 11:Redundancy group configuration\.The group imbalance — particularly GRP\_USER\_IDENTITY with 8 members against a 30% cap — is the primary structural factor behind the repeated selection of engagement\-only elements \(E01, E02, E05\) as key evidence in false positive sessions\. In approximately 85% of OSPI sessions \(Returning Visitors\), E07 outputs loyalty\_score∈\[0\.70,0\.88\]\\in\[0\.70,0\.88\], consuming a disproportionate portion of the group quota and suppressing E05, E06, and E08 contributions\. Future work should either raise the GRP\_USER\_IDENTITY cap or reduce the number of members to restore balance\.

## Appendix DPrompt Architecture for LLM\-Driven Inference

The LLM\-driven inference engine uses three distinct system prompt files, each stored as an external markdown document in theprompts/system/directory\. This separation allows prompt modification without code changes; updated prompts take effect on the next process start\. A fourth file \(prompts/global\_constraints\.md\) is automatically prepended to every LLM call as a cross\-cutting constraint document\.

### D\.1Prompt File Summary

Table 12:Prompt file summary for LLM engine\.
### D\.2On\-Demand Element Loading Architecture

This Phase 1→\\rightarrowPhase 2 selective loading architecture reflects principles introduced in SPARK\_AI\[[8](https://arxiv.org/html/2606.11207#bib.bib7)\], a prompt\-orchestrated system that governs LLM reasoning through stateful, process\-oriented workflows rather than ad hoc generation\. SPARK\_AI demonstrates that structured prompt orchestration significantly improves LLM reasoning reliability and interpretability\. SemantiClean’s element library serves an analogous role to SPARK\_AI’s structured state: grounding LLM inference in pre\-validated behavioural knowledge rather than free\-form text generation\[[8](https://arxiv.org/html/2606.11207#bib.bib7)\]\.

A key design decision in the engine is the separation of Phase 1 \(lightweight routing\) and Phase 2 \(full element payload\)\. Rather than loading all 24 element definitions into every LLM call — which would consume approximately 16,000\+ tokens for a naive full\-library dump — the engine implements on\-demand selective loading:

Table 13:On\-demand element loading token budget\.This architecture reduces per\-session token consumption from∼\\sim16,000\+ tokens \(full library dump\) to approximately 6,000–13,000 tokens depending on how many elements Phase 1 selects\. The critical property is that no element definition is disclosed to the LLM before Phase 1 routing confirms its relevance, preserving the semantic integrity of the element selection decision and preventing the LLM from being influenced by element content it was not intended to use\.

### D\.3Masked Field Inference Protocol \(Exp\-A\)

Themasked\_field\_inference\.mdprompt implements a three\-step protocol specifically designed for the experimental validation described in §[4\.7](https://arxiv.org/html/2606.11207#S4.SS7):

#### Step 1 — Signal Extraction\.

The LLM computes each element’s signal value by applyingcomputation\.formulato the visible session fields\. If a required field is absent due to masking,signal\_valueis set to 0\.0 andstatusis set to ’skipped’\. If partial fields allow estimation,statusis set to ’degraded’ and confidence is capped\.

#### Step 2 — Multi\-Element Aggregation\.

Signal values are weighted by element confidence and accumulated toward label scores, subject to redundancy group caps\. Conflicting signals from bias\-flagged elements trigger TieredPenaltyCalculator application\.

#### Step 3 — Decision Output\.

The prompt enforces JSON\-only output containingelement\_signals\(per\-element signal value, confidence, derivation, status\),prediction\(target label or ’uncertain’\),confidence\(0–1\),decision\_reason\(citing specific element names and values\), andkey\_evidence\(top\-3 contributing elements\)\.

The prompt explicitly prohibits use of any field listed in the\_\_masked\_fields\_\_metadata tag\. This prohibition is enforced at the prompt level; the session dictionary itself also has theRevenuekey removed by Python before the LLM call, providing a defense\-in\-depth approach to field masking\.

Similar Articles

semantica-agi/semantica

GitHub Trending (daily)

Semantica is an open-source, graph-native infrastructure platform for building context-aware and accountable AI systems. It ingests enterprise data, builds knowledge/context graphs, and provides graph analytics, causal reasoning, and end-to-end decision provenance.