Triple classification is a binary machine learning task that determines whether a given (head entity, relation, tail entity) statement is true or false based on a trained model's scoring function. It serves as a direct evaluation benchmark for knowledge graph embedding (KGE) models, testing their discriminative power rather than their generative ranking capability. The model assigns a probability or score to a candidate triple; a threshold is then applied to classify it as valid or invalid.
Glossary
Triple Classification

What is Triple Classification?
Triple classification is a core evaluation task in knowledge graph completion (KGC) that assesses a model's ability to discern factual statements from false ones.
This task operates under a Closed World Assumption (CWA) for evaluation, where triples not in the known graph are presumed false. It contrasts with the generative task of link prediction, which ranks plausible completions. Triple classification is fundamental for applications requiring fact verification, such as knowledge graph question answering (KGQA) and data quality assessment, providing a clear metric for model accuracy in discerning factual knowledge.
Key Characteristics of Triple Classification
Triple classification is a binary evaluation task for knowledge graph completion models. It assesses a trained model's ability to discriminate between true and false factual statements, providing a direct measure of its discriminative power.
Binary Discriminative Task
Unlike link prediction, which ranks plausible entities, triple classification is a binary classification problem. Given a candidate triple (head, relation, tail), a trained model must output a probability score indicating whether the statement is true or false. This directly tests the model's learned decision boundary between valid and invalid facts.
- Objective: Determine
P(true | (h, r, t)). - Contrast: Link prediction answers 'what is the missing entity?' while triple classification answers 'is this specific statement true?'.
Dependent on Embedding Quality
The performance of a triple classifier is wholly dependent on the quality of the underlying knowledge graph embeddings (KGE). The model uses the geometric or algebraic relationships between the learned entity and relation vectors to compute a plausibility score.
- Scoring Function: Models like TransE use
f(h, r, t) = -||h + r - t||to score triples. A high score suggests truth. - Thresholding: A classification threshold is applied to the continuous score to make the final true/false decision, often tuned on a validation set.
Requires Corrupted Negatives
Training and evaluating a triple classifier requires a robust set of negative examples—triples that are false. Since knowledge graphs only contain true facts, negatives are created through corruption.
- Common Techniques: Replacing the head or tail entity of a true triple with a random entity (e.g., (Paris, capitalOf, Germany)).
- Evaluation Protocol: Standard benchmarks like FB15k-237 and WN18RR provide predefined sets of corrupted negatives for fair evaluation, preventing easy-to-spot false triples.
Standard Evaluation Metrics
Performance is measured using standard binary classification metrics, which provide a clear, interpretable assessment of discriminative capability.
- Accuracy: The proportion of triples correctly classified.
- Precision, Recall, and F1-Score: Crucial for imbalanced datasets.
- Area Under the ROC Curve (AUC-ROC): Measures the model's ability to rank true triples higher than false ones across all classification thresholds. AUC is often the primary reported metric.
Contrast with Link Prediction
Triple classification and link prediction are complementary evaluation tasks for the same underlying KGE model, testing different capabilities.
| Aspect | Triple Classification | Link Prediction |
|---|---|---|
| Task | Verify a specific fact. | Predict a missing entity. |
| Output | True/False label. | Ranked list of candidate entities. |
| Primary Metric | Accuracy, F1, AUC. | Hits@K, MRR. |
| Use Case | Fact-checking, data validation. | Knowledge graph population, query answering. |
Foundation for Downstream Tasks
A robust triple classifier is a core component enabling higher-level applications that require factual verification.
- Knowledge Graph Curation: Automatically flagging likely false entries during data integration.
- Fact-Checking Systems: Verifying candidate facts extracted from text against a trusted knowledge base.
- Graph-Based RAG: In Retrieval-Augmented Generation, a classifier can filter retrieved knowledge graph triples for factual grounding, ensuring only high-confidence facts are passed to the LLM to reduce hallucinations.
How Triple Classification Works
Triple classification is a core evaluation task in knowledge graph completion (KGC) that assesses a model's ability to discern factual statements from false ones.
Triple classification is a binary evaluation task that determines whether a given (head entity, relation, tail entity) statement is true or false based on a trained model's scoring function. Unlike link prediction, which ranks plausible entities to complete a triple, classification provides a definitive true/false judgment. It directly tests a model's discriminative power and is a critical benchmark for knowledge graph embedding (KGE) models like TransE and ComplEx.
The process involves scoring a candidate triple against a learned decision threshold; scores above the threshold are classified as true. Performance is measured using standard binary classification metrics like accuracy, precision, and F1-score. This task operates under the Closed World Assumption (CWA) for evaluation, where any fact not in the known graph is considered false, providing a clear ground truth for model validation.
Triple Classification vs. Link Prediction
A comparison of the two primary evaluation tasks for Knowledge Graph Completion (KGC) models, highlighting their distinct objectives, methodologies, and use cases.
| Feature | Triple Classification | Link Prediction |
|---|---|---|
Primary Objective | Determine if a given (head, relation, tail) statement is true or false. | Predict a missing entity (head or tail) for a given (head, relation, ?) or (?, relation, tail) query. |
Task Type | Binary classification / verification. | Ranking / entity prediction. |
Input | A complete candidate triple (h, r, t). | A partial triple with one missing entity: (h, r, ?) or (?, r, t). |
Output | A binary label (True/False) or a probability score. | A ranked list of candidate entities to complete the triple. |
Core Evaluation Metric | Accuracy, Precision, Recall, F1-Score, AUC-ROC. | Hits@K (e.g., Hits@1, Hits@10), Mean Reciprocal Rank (MRR). |
Model Scoring Use | The model's scoring function f(h, r, t) is thresholded to produce a True/False decision. | The model scores f(h, r, e) for all candidate entities e; entities are ranked by score. |
Typical Use Case | Fact-checking, validating knowledge graph integrity, filtering candidate triples from extraction pipelines. | Knowledge graph population, inferring missing connections, recommendation systems, query answering. |
Assumption Context | Often operates under a Closed World Assumption (CWA) for evaluation, where negatives are explicitly defined. | Inherently operates under an Open World Assumption (OWA), predicting over all possible entities. |
Relation to Training | Directly uses the model's learned scoring function without modification for the task. | The core training objective of most KGE models; classification is a derived application of the scoring function. |
Common Evaluation Metrics
Triple classification is evaluated using metrics that measure a model's ability to correctly label a given (head, relation, tail) statement as true or false. These metrics assess binary classification performance on a held-out set of positive and negative triples.
Accuracy
Accuracy is the most straightforward metric, calculated as the proportion of triples (both true and false) that are correctly classified by the model. It provides an overall measure of performance but can be misleading in imbalanced datasets where the number of positive and negative examples is unequal.
- Formula: (True Positives + True Negatives) / Total Predictions
- Use Case: Best suited for preliminary assessment when the test set is perfectly balanced.
- Limitation: A high accuracy score can be achieved by a trivial model if, for example, 90% of test triples are negative; the model could simply predict 'false' for everything.
Precision, Recall, and F1-Score
These metrics provide a more nuanced view than accuracy by evaluating performance on the positive class (true triples) separately.
- Precision: Measures the model's exactness. Of all triples predicted as true, what fraction are actually true? High precision indicates few false positives.
- Recall (Sensitivity): Measures the model's completeness. Of all actual true triples, what fraction did the model correctly identify? High recall indicates few false negatives.
- F1-Score: The harmonic mean of precision and recall, providing a single balanced metric, especially useful when the class distribution is skewed. It is the preferred metric for reporting triple classification performance on standard benchmarks like FB15k-237 and WN18RR.
Area Under the ROC Curve (AUC-ROC)
The Area Under the Receiver Operating Characteristic Curve (AUC-ROC) evaluates the model's ability to rank true triples higher than false triples across all possible classification thresholds. The ROC curve plots the True Positive Rate (Recall) against the False Positive Rate at various threshold settings.
- Interpretation: An AUC of 1.0 represents a perfect classifier; 0.5 represents a random classifier.
- Advantage: It is threshold-agnostic, providing an aggregate measure of performance across all possible decision boundaries. This makes it robust to class imbalance.
- Context: While common in binary classification, for triple classification, the F1-score at an optimal threshold is often reported alongside AUC-ROC for a complete picture.
Area Under the PR Curve (AUC-PR)
The Area Under the Precision-Recall Curve (AUC-PR) is often more informative than AUC-ROC for highly imbalanced datasets, which is typical in triple classification where negative (false) triples vastly outnumber positives.
- Focus: The PR curve plots precision against recall, directly highlighting the trade-off that matters most when the positive class is rare.
- Interpretation: A high AUC-PR score indicates the model maintains high precision even as recall increases, which is critical for practical applications where false positives are costly.
- Comparison: In imbalanced scenarios, a significant drop in AUC-PR is a clearer signal of performance degradation than a drop in AUC-ROC.
Confusion Matrix Analysis
The confusion matrix is a fundamental table that breaks down predictions into four categories: True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). It is the basis for calculating all other metrics.
- Diagnostic Power: Analyzing the matrix reveals the specific types of errors a model makes. For example:
- High FP: The model is too liberal, often hallucinating facts.
- High FN: The model is too conservative, missing valid facts.
- Relation-Specific Analysis: Performance often varies drastically by relation type (e.g., symmetric vs. asymmetric). Generating separate confusion matrices per relation can uncover where a model fails, guiding targeted improvements in embedding space or rule learning.
Threshold Selection & Calibration
Triple classification models output a continuous score (e.g., a probability or distance metric). Converting this to a binary true/false label requires selecting a decision threshold. This is a critical, often overlooked, aspect of evaluation.
- Optimal Threshold: The threshold that maximizes the F1-score on a validation set is typically chosen for final evaluation. It is not always 0.5.
- Calibration: A model is well-calibrated if its output score directly reflects the true probability of the triple being correct. Poor calibration means a score of 0.9 may not correspond to a 90% chance of being true, making threshold selection unreliable. Techniques like Platt Scaling or Isotonic Regression can calibrate model scores post-training.
- Impact: The chosen threshold directly impacts precision and recall trade-offs reported in production systems.
Frequently Asked Questions
Triple classification is a core evaluation task for Knowledge Graph Completion (KGC) models. This FAQ addresses common technical questions about its purpose, methodology, and relationship to other KGC tasks.
Triple classification is a binary evaluation task that determines whether a given (head, relation, tail) statement is factually true or false based on the scoring function of a trained Knowledge Graph Embedding (KGE) or reasoning model. Unlike link prediction, which ranks candidate entities to fill a missing element, triple classification directly assesses the model's confidence in the veracity of a complete, specific triple.
It operates by applying a scoring function (e.g., TransE's distance metric or ComplEx's complex dot product) to the triple. The resulting score is compared against a learned or pre-defined decision threshold. Scores above the threshold classify the triple as 'true' (plausible), while scores below classify it as 'false' (implausible). This task is fundamental for evaluating a model's discriminative power and its ability to act as a fact-checker over incomplete knowledge bases.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Triple classification is a core evaluation task within the broader field of Knowledge Graph Completion (KGC). These related terms define the models, techniques, and evaluation paradigms used to infer missing facts.
Knowledge Graph Completion (KGC)
Knowledge Graph Completion (KGC) is the overarching machine learning task of inferring missing facts, links, or attributes within a knowledge graph to enhance its coverage and utility. It encompasses several subtasks:
- Link Prediction: Predicting a missing relationship between two known entities.
- Entity Prediction: Predicting a missing entity in a triple (e.g., predicting the tail entity given head and relation).
- Relation Prediction: Predicting the relationship between two known entities. Triple classification is a key evaluation method for assessing the performance of KGC models.
Link Prediction
Link prediction is the primary KGC task of predicting the existence of a missing relationship (link) between two entities in a knowledge graph. Unlike triple classification, which judges a single candidate triple, link prediction typically involves ranking a set of candidate entities or relations. For example, given (Paris, capitalOf, ?), a model ranks all possible tail entities. It is the generative task for which models like TransE are trained, and triple classification is a discriminative evaluation of that model's scoring function.
Knowledge Graph Embedding (KGE)
Knowledge Graph Embedding (KGE) is a foundational technique for KGC that maps entities and relations to low-dimensional, continuous vector spaces. These embeddings capture semantic similarities and relational patterns, enabling mathematical operations for prediction.
- Purpose: To transform discrete graph elements into vectors so that plausible triples have a high score (e.g., head + relation ≈ tail in TransE).
- Models: Include translational models (TransE, RotatE), factorization models (DistMult, ComplEx), and neural models (ConvE). The scoring function of a KGE model is directly used in triple classification to assign a truth score to a candidate triple.
Negative Sampling
Negative sampling is a critical training technique for KGE models. Because knowledge graphs contain only positive (true) facts, models need negative examples to learn discrimination.
- Process: For each true training triple (h, r, t), one or more 'corrupted' triples are created by randomly replacing the head or tail entity (e.g., (h', r, t) or (h, r, t')).
- Objective: The model learns to assign high scores to true triples and low scores to these generated negatives. The quality of triple classification depends heavily on how well the model was trained to distinguish such negatives from positives.
Hits@K & Mean Reciprocal Rank (MRR)
Hits@K and Mean Reciprocal Rank (MRR) are the standard ranking metrics for evaluating link prediction models, which provide context for triple classification.
- Hits@K: Measures the percentage of test queries where the correct entity appears in the top K ranked predictions. Common values are Hits@1, Hits@3, and Hits@10.
- Mean Reciprocal Rank (MRR): Averages the reciprocal of the rank of the first correct answer across all queries. It provides a smoother measure of overall ranking quality. While triple classification gives a binary accuracy, these metrics assess the model's ranking precision, which is often the primary goal in KGC.
Rule Mining
Rule mining is a symbolic, logic-based approach to KGC that complements embedding-based methods. It involves automatically discovering logical rules that hold within the knowledge graph.
- Example Rule:
bornIn(X, Y) ∧ locatedIn(Y, Z) ⇒ nationality(X, Z) - Application: Mined rules can be used to infer new facts deductively. A triple can be classified as 'true' if it can be derived by applying a learned rule to existing facts. This represents a different paradigm from neural embedding models, and hybrid neural-symbolic systems often combine both for more robust reasoning and classification.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us