Inferensys

Glossary

Semantic Integrity

Semantic integrity is a quality dimension for synthetic data that ensures the logical relationships and constraints between attributes and entities are preserved in generated samples.
Large-scale analytics wall displaying performance trends and system relationships.
SYNTHETIC DATA VALIDATION

What is Semantic Integrity?

A core quality dimension for evaluating synthetic structured data, ensuring generated samples preserve the logical relationships and constraints inherent in the original data.

Semantic integrity is a quality metric for synthetic data, particularly for structured or relational datasets, that measures the preservation of logical relationships, business rules, and constraints between attributes and entities in the generated samples. It ensures that synthetic records are not just statistically similar but are also semantically plausible and internally consistent. For example, in a customer database, semantic integrity would enforce that a date_of_birth logically precedes an account_creation_date, or that a purchase_amount aligns with a valid product_category.

Violations of semantic integrity render synthetic data useless for training reliable machine learning models, as they introduce illogical correlations and impossible states that corrupt the model's understanding of the domain. Validation involves checking referential integrity (e.g., foreign key relationships), functional dependencies, value range constraints, and temporal consistency. Unlike purely statistical metrics like Fréchet Inception Distance (FID), semantic integrity requires domain-specific rule sets or learned constraints to audit the logical soundness of each generated record.

SYNTHETIC DATA VALIDATION

Key Characteristics of Semantic Integrity

Semantic integrity ensures generated data preserves the logical rules, constraints, and relationships inherent in the source domain. It is a critical quality dimension for structured and relational synthetic data.

01

Preservation of Logical Constraints

Semantic integrity enforces hard business rules and domain logic that cannot be violated. For example, in a synthetic e-commerce dataset:

  • A ship_date must be on or after the order_date.
  • A total_price must equal the sum of item_price * quantity for all line items.
  • A patient_age must be a positive integer, and a diagnosis_date cannot precede date_of_birth. Violating these constraints renders data implausible and useless for training or testing logic-dependent applications.
02

Maintenance of Referential Integrity

This characteristic ensures consistency across related database tables or entities. Key relationships must be preserved:

  • Foreign Key Relationships: A synthetic customer_id in an orders table must exist in the customers table.
  • Cardinality: One-to-many and many-to-many relationships (e.g., a doctor has many patients) must be statistically maintained.
  • Hierarchical Data: Parent-child relationships in organizational charts or product categories must remain logically connected. Failure here breaks the dataset's relational structure, making it unsuitable for testing complex joins or training models on interconnected data.
03

Consistency of Attribute Dependencies

Beyond explicit constraints, semantic integrity captures probabilistic correlations and soft dependencies between attributes. A high-fidelity synthetic dataset must replicate these:

  • Statistical Correlations: Higher engine_size correlates with lower fuel_economy in vehicle data.
  • Categorical Co-occurrences: The job_title "Neurosurgeon" should only co-occur with education_level "MD" or "PhD".
  • Temporal Dependencies: In time-series data, a spike in website_traffic often precedes an increase in sales_conversions. Generators must model these multivariate relationships to produce coherent, contextually accurate records.
04

Absence of Contradictory Information

A single synthetic record must be internally consistent. Contradictions indicate a breakdown in semantic understanding by the generator. Examples include:

  • A patient record listing blood_type: 'O-' and a recent transfusion_history showing receipt of 'B+' blood.
  • A weather record with temperature: -5°C and precipitation: 'heavy rain' (rain is implausible at that temperature).
  • A financial transaction where transaction_type: 'wire' and clearing_time: 'instant' (wires typically take 1-2 days). Detection often requires rule-based validators or consistency classifiers run as part of the validation pipeline.
05

Domain-Specific Plausibility

Semantic integrity requires that every generated sample is plausible within its specific domain, even if it wasn't present in the original dataset. This involves:

  • Adhering to Physical Laws: In synthetic sensor data, acceleration cannot change instantaneously.
  • Following Regulatory Rules: Synthetic financial transactions must obey Anti-Money Laundering (AML) patterns (e.g., structuring deposits to avoid reporting thresholds is a known pattern).
  • Mimicking Behavioral Norms: In synthetic user logs, session duration and click patterns should follow known human-computer interaction models. This goes beyond statistical matching to require a causal understanding of the data-generating process.
06

Validation via Downstream Task Performance

The ultimate test of semantic integrity is utility. A synthetically trained model should perform nearly as well on real-world tasks as one trained on real data. Key evaluation protocols include:

  • Train-on-Synthetic, Test-on-Real (TSTR): Train a classifier/regressor on synthetic data, evaluate its accuracy on held-out real data. A significant performance drop indicates poor semantic integrity.
  • Logic Test Suites: Create unit tests that query the synthetic dataset for known logical relationships (e.g., "all invoices must have a valid customer ID") and assert they hold.
  • Domain Expert Review: Human-in-the-loop validation where subject matter experts spot-check records for logical coherence and flag implausible combinations.
SYNTHETIC DATA VALIDATION

How is Semantic Integrity Validated?

Semantic integrity validation ensures synthetic data preserves the logical rules and relationships inherent in the source domain, which is critical for structured and relational datasets.

Semantic integrity is validated by testing whether the generated data adheres to the logical constraints, functional dependencies, and entity relationships defined by the source domain's schema and business rules. This goes beyond statistical fidelity to ensure data plausibility and coherence. Common validation techniques include rule-based checks (e.g., a person's age must be positive), consistency metrics (e.g., verifying referential integrity between tables), and training domain classifiers to detect illogical samples.

Advanced validation employs probabilistic graphical models or knowledge graphs to encode complex domain semantics, against which synthetic samples are scored. The Train-on-Synthetic Test-on-Real (TSTR) protocol is a key utility test, where a downstream model trained on the synthetic data must perform well on real data, implicitly validating semantic rules. Failure indicates the synthetic data lacks the causal structures necessary for generalization.

VALIDATION FAILURE MODES

Common Semantic Integrity Violations

This table catalogs specific failures where synthetic structured data violates the logical, relational, or business rule constraints inherent in the source data.

Violation TypeDescriptionExampleDetection MethodSeverity

Referential Integrity Failure

A foreign key value in a synthetic record references a primary key that does not exist in the related synthetic table.

A synthetic order record contains a customer_id that is not present in the synthetic customers table.

Database constraint check or join analysis between tables.

Cardinality Constraint Violation

The generated data violates defined relationship cardinalities (e.g., one-to-many, many-to-one).

A synthetic dataset generates multiple current_employer records for a single employee, violating a one-to-one relationship.

Entity-relationship analysis and count aggregations.

Functional Dependency Violation

The value of an attribute is not uniquely determined by the value of another attribute, breaking a real-world rule.

Two synthetic patient records share the same patient_id but have different date_of_birth values.

Primary key uniqueness checks and group-by analysis on determinant attributes.

Attribute Range/Type Violation

A generated value falls outside the permissible domain or data type for that attribute.

A synthetic age field contains a negative value or a string like 'middle-aged'.

Statistical summary (min, max) and data type profiling.

Logical Consistency Violation

Contradictory values exist within a single record or across related records.

A synthetic transaction has a status of 'CANCELLED' but a settlement_amount greater than zero.

Business rule validation using conditional logic checks.

Temporal Anomaly

The sequence or timing of events is illogical or impossible.

A synthetic insurance_claim has a date_filed that is earlier than the policy_start_date.

Temporal logic checks and sequencing analysis.

Statistical Distribution Skew

The joint or marginal distribution of related attributes deviates implausibly from the source data, breaking semantic correlations.

The synthetic correlation between income and credit_score is near zero, whereas the real data shows a strong positive correlation.

Multivariate statistical tests (e.g., contingency tables, correlation comparison).

Hierarchical Integrity Failure

Violations within parent-child or tree-structured data, such as incorrect lineage or level skipping.

In synthetic organizational data, an employee reports to a manager who is at a lower pay grade level.

Graph traversal algorithms and hierarchical rule validation.

SEMANTIC INTEGRITY

Frequently Asked Questions

Semantic integrity is a critical quality dimension for synthetic structured data, ensuring generated records preserve the logical relationships and real-world constraints inherent in the source data.

Semantic integrity is the property of a synthetic dataset where the logical, real-world relationships and constraints between data attributes and entities are preserved. It ensures that generated records are not just statistically plausible in isolation but are also contextually coherent and respect the underlying business rules or physical laws of the source domain. For example, in a synthetic customer database, semantic integrity would guarantee that a purchase_date always occurs after the corresponding account_creation_date, or that a hospital_discharge_date is logically consistent with the admission_date and diagnosis_codes. This goes beyond matching univariate marginal distributions to enforce multi-attribute consistency, which is essential for the synthetic data to be useful for training reliable machine learning models or for accurate analytics.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.