Skip to content

Repository files navigation

ruleeval-xd

Binary classification benchmark for rule-based reasoning.

Domains

Legal Reasoning: Hearsay Determination

Source: LegalBench (Hearsay)

This task evaluates a model's ability to identify inadmissible hearsay under the Federal Rules of Evidence.

Natural Language Question

The baseline prompt asks the model to determine whether a specific piece of evidence meets the criteria for hearsay given a particular legal issue:

Does the provided evidence constitute hearsay in the context of the issue being litigated?

First-Order Logic Expression

To ensure logical consistency and formal verification, the task is decomposed into entity identification and predicate extraction, governed by the following rule as defined in Sadowski & Chudziak (2025):

$$ \text{IsHearsay}(s, I) \iff \text{IsStatement}(s) \land \text{IsOutOfCourt}(s) \land \exists a \big( \text{HasAssertion}(s, a) \land \text{IntroducedForLegalIssue}(s, I) \land \text{ProvesTruthOfAssertion}(s, I) \big) $$

Where:

  • Terms (Entities):
    • $s$: A communicative act (oral, written, or non-verbal assertive conduct).
    • $I$: The specific legal issue or disputed matter being litigated.
    • $a$: The specific factual claim or proposition conveyed by the statement.
  • Predicates:
    • $\text{IsStatement}(s)$: The act $s$ is assertive conduct intended to communicate information.
    • $\text{IsOutOfCourt}(s)$: The statement was made outside of the current trial or hearing.
    • $\text{HasAssertion}(s, a)$: The statement $s$ contains a specific factual claim $a$.
    • $\text{IntroducedForLegalIssue}(s, I)$: The statement is offered specifically to resolve the disputed matter $I$.
    • $\text{ProvesTruthOfAssertion}(s, I)$: The statement's probative value depends on establishing the truth of the assertion.

Answer Interpretation

The binary label reflects whether the deterministic chain of legal inference is satisfied.

  • YES (Positive Class):
    • Logic: The logical expression evaluates to True.
    • Interpretation: The evidence is an out-of-court statement being used specifically to prove what the speaker originally asserted.
    • Example: "To prove that the insured under a life policy is dead, his wife offers a death certificate."
  • NO (Negative Class):
    • Logic: The logical expression evaluates to False.
    • Interpretation: The evidence fails at least one hearsay criteria, such as being a statement made in court, non-assertive conduct, or introduced for purposes other than proving its truth.
    • Example: "On the issue of whether Will knew that the company intended to announce its drug trials had been cancelled, the fact that he told the jury that 'he didn't know the first thing about how medicines worked.'"

Medical Diagnostics: URTI Differential

Source: huggingface.co (DDXPlus)

This task evaluates a model's ability to perform differential diagnosis using the principle of Diagnosis of Exclusion. The model must determine if a patient's presentation justifies a general diagnosis of Upper Respiratory Tract Infection (URTI) or if the clinical evidence fulfills the criteria for a more specific respiratory pathology.

Natural Language Question

The baseline prompt asks the model to evaluate symptoms against specific exclusion criteria:

Is URTI (Upper Respiratory Tract Infection) the correct diagnosis, or does a more specific respiratory condition apply?

First-Order Logic Expression

To ensure clinical safety and explainability, the diagnosis is treated as a logical exclusion. URTI is valid if and only if no specific respiratory condition ($c$) from the set of candidate pathologies ($S$) meets its diagnostic criteria.

$$ \text{IsURTI}(p) \iff \text{RespSymptoms}(p) \land \neg \exists c \in S . \text{HasCriteria}(p, c) $$

Where:

  • $S$ (Specific Conditions): {Pneumonia, Bronchitis, Influenza, Tuberculosis, Pharyngitis, Sinusitis, Acute Laryngitis, Bronchiectasis, Viral Pharyngitis, Rhinosinusitis}.
  • Predicates:
    • $\text{HasCriteria}(p, c)$: Patient $p$ exhibits hallmark indicators (e.g., high fever, purulent sputum, chronic duration) that define condition $c$.

Answer Interpretation

The binary label reflects whether the "Exclusion" rule holds based on the presence or absence of "red flag" indicators.

  • YES (Positive Class):

    • Logic: The logical expression evaluates to True.
    • Interpretation: Symptoms are mild and non-specific (nasal congestion, mild sore throat). Crucially, the presentation lacks features of more severe or specific conditions.
    • Example: "Patient presents with a runny nose and a mild cough for 2 days. No fever or chest pain."
  • NO (Negative Class):

    • Logic: The logical expression evaluates to False.
    • Interpretation: The patient presentation includes at least one specific indicator (Hard Negatives) that triggers a more precise diagnosis.
    • Example: "Patient has a runny nose but also reports a high fever (39°C) and severe muscle aches." (Indicator for Influenza $\to$ NOT URTI).

Dataset Construction

The benchmark utilizes a "Least Confusing" selection strategy from the DDXPlus dataset to challenge the model's boundary-case reasoning:

Case Type Selection Criteria
Positive Ground truth is URTI. Differential includes at least one specific respiratory disease with $\ge 5%$ probability. Sorted by least confusing.
Negative Ground truth is a specific respiratory disease. URTI was considered in the differential with $\ge 5%$ probability. Sorted by least confusing.

Specific conditions included in $S$: Pneumonia, bronchitis, influenza, tuberculosis, acute laryngitis, bronchiectasis, viral pharyngitis, acute rhinosinusitis, chronic rhinosinusitis.

Medical Diagnostics: Allergic Rhinitis

Source: huggingface.co (DDXPlus) — pathology label Allergic sinusitis.

This task evaluates a model's ability to distinguish allergic upper-airway inflammation from clinically confusable infectious conditions. Unlike the URTI task — which is governed by an exclusion rule — Allergic Rhinitis is governed by an inclusion + bounded exclusion rule. The contrast in logical shape is the point: it tests whether rule-based evaluation generalises across rule structures within the same data source.

Natural Language Question

Does the patient's presentation justify a diagnosis of Allergic Rhinitis, or does an infectious respiratory condition apply?

First-Order Logic Expression

$$ \text{IsAR}(p) \iff \text{HasAtopicFeatures}(p) \land \exists t., \text{AllergenTrigger}(p, t) \land \neg \text{HasInfectiousFeatures}(p) $$

Where:

  • Predicates:
    • $\text{HasAtopicFeatures}(p)$: Patient $p$ exhibits hallmark allergic indicators — sneezing, itchy nose / eyes / palate, watery rhinorrhoea, wheeze without fever, history of asthma / eczema / prior allergy.
    • $\text{AllergenTrigger}(p, t)$: Patient $p$ has identifiable exposure to allergen $t$ — pollen / seasonal, dust, animals, occupational, food.
    • $\text{HasInfectiousFeatures}(p)$: Patient $p$ shows signs of infection — fever, purulent sputum, productive cough with infection, sick contacts, severe systemic illness.

Answer Interpretation

  • YES (Positive Class):

    • Logic: The logical expression evaluates to True.
    • Interpretation: The patient has atopic features tied to an identifiable trigger, without infectious red flags.
    • Example: "Patient reports recurrent sneezing fits and itchy eyes when around the family cat; no fever, no purulent discharge."
  • NO (Negative Class):

    • Logic: The logical expression evaluates to False.
    • Interpretation: The presentation includes infectious features (or lacks atopic features / a trigger) such that an infectious condition is the correct diagnosis.
    • Example: "Patient has nasal congestion and a productive cough with green sputum and a fever of 38.5°C." (Indicator for Bronchitis $\to$ NOT Allergic Rhinitis).

Rule-Shape Contrast (vs. URTI)

Task Rule shape Reasoning pattern
URTI $\text{RespSymptoms}(p) \land \neg\exists c \in S., \text{HasCriteria}(p, c)$ Pure exclusion: rule out every specific condition
Allergic Rhinitis $\text{HasAtopicFeatures}(p) \land \exists t., \text{AllergenTrigger}(p, t) \land \neg \text{HasInfectiousFeatures}(p)$ Inclusion (positive criteria + trigger) with bounded exclusion of one feature class

Dataset Construction

The benchmark uses the same "Least Confusing" selection strategy as URTI:

Case Type Selection Criteria
Positive Ground truth is Allergic sinusitis. Differential includes at least one confusable infection with $\ge 5%$ probability. Sorted by least confusing (ascending sum of confusable probabilities).
Negative Ground truth is a confusable infection. Allergic sinusitis was considered in the differential with $\ge 5%$ probability. Sorted by least confusing (ascending AR probability).

Confusable infections included: Bronchitis, Pneumonia, Influenza, Croup.

Note on Empirical vs. Clinical Confusables

The set above is empirically derived from DDXPlus's differential structure, not from clinical priors. A clinician would expect the natural confusables for Allergic Rhinitis to be other upper-airway conditions — URTI, acute / chronic rhinosinusitis, viral pharyngitis. In DDXPlus, however, those conditions almost never carry Allergic sinusitis in their differentials: when ground truth is URTI or rhinosinusitis, the AR probability is $<5%$ in 100% of cases. Instead, DDXPlus places AR adjacent to lower-airway (bronchitis, pneumonia) and systemic viral (influenza, croup) conditions — likely because DDXPlus AR cases include cough / wheeze symptoms that overlap with these infectious presentations.

We follow the data, not the clinical intuition. This is intentional: rule-based evaluation should be testable against whichever confusion structure the data exposes, and the resulting rule (atopic features + trigger, absent infection) cleanly discriminates the actual decision boundary the dataset presents.

Viral pharyngitis was further excluded from the confusable set because its negative-pool size differs by three orders of magnitude between train (1,058) and test (1), which would create an unreliable train/test distribution.

Scientific Method Application

Source: huggingface.co

This task evaluates a model's ability to determine whether a scientific abstract describes a specific computational Method being applied to a specific Task. It is derived from the SciERC dataset and formulated as a binary classification problem.

Natural Language Question

The baseline prompt asks the model to determine if a functional "used-for" relationship exists between identified entities:

Does the text describe a scientific method, model, or tool being explicitly used for, applied to, or designed for a specific task or application?

First-Order Logic Expression

To ensure explainability, the reasoning process is decomposed into entity identification and predicate verification. The final determination is governed by the following logical rule:

$$ \text{Applicable}(s) \iff \exists m, t . \Big( \text{IsMethod}(m) \land \text{IsTask}(t) \land \text{UsedFor}(m, t) \Big) $$

Where:

  • Terms (Entities):
    • $m$ (Method): Algorithms, models, tools, or system components (e.g., "LSTM", "kernel method").
    • $t$ (Task): Applications, problems to solve, or systems to construct (e.g., "information extraction", "image segmentation").
  • Predicates:
    • $\text{UsedFor}(m, t)$: A directed relationship indicating that method $m$ is used to solve task $t$, or that $m$ is trained on/exploits $t$.

Answer Interpretation

The binary label reflects whether the specific UsedFor condition is met, distinguishing it from other valid scientific relationships found in the dataset.

  • YES (Positive Class):

    • Logic: The logical expression evaluates to True.
    • Interpretation: The text explicitly links a method and a task via application.
    • Example: "The TISPER system has been designed to enable text applications." (Relation: Used-For).
  • NO (Negative Class):

    • Logic: The logical expression evaluates to False.
    • Interpretation: While the text may contain scientific terms or other relationships, it does not describe a method application. This includes "Hard Negatives" such as taxonomic definitions or part-whole relationships.
    • Example: "TUIT is a software library." (Relation: Hyponym-Of, not Used-For).

Clinical Trial Eligibility NLI

Source: huggingface.co (NLI4CT)

This task evaluates a model's ability to determine whether a natural language statement about clinical trial eligibility logically follows from (entails) or contradicts the stated inclusion/exclusion criteria. It requires interpreting medical terminology, applying logical inference, and recognizing synonyms.

Natural Language Question

The baseline prompt asks the model to verify logical consistency:

Does the statement accurately follow from the eligibility criteria?

First-Order Logic Expression

$$ \text{Entails}(s, p) \iff \text{IsEligibilityStatement}(s) \land \text{IsEligibilityCriteria}(p) \land \text{StatementFollowsFromPremise}(s, p) $$

Where:

  • Terms:
    • $s$ (Statement): A claim about clinical trial eligibility (e.g., "Patients with stage II T2 N2 carcinoma are not eligible").
    • $p$ (Premise): The inclusion and/or exclusion criteria from a clinical trial.
  • Predicates:
    • $\text{StatementFollowsFromPremise}(s, p)$: The statement's claim logically follows from the criteria, accounting for synonyms (e.g., "claustrophobia" = "fear of confined spaces") and logical implications (e.g., if inclusion requires N0 or N1, then N2 is excluded).

Answer Interpretation

  • YES (Entailment):

    • Logic: The statement logically follows from the premise.
    • Example: Premise: "Exclusion: Known claustrophobia" → Statement: "Patients with irrational fear of confined spaces are not eligible."
  • NO (Contradiction):

    • Logic: The statement conflicts with or cannot be derived from the premise.
    • Example: Premise: "Inclusion: Age ≥ 18" → Statement: "Pediatric patients are eligible for the trial."

Dataset Construction

Filtered from NLI4CT to eligibility-related instances:

Filter Criteria
Section sentence1 contains "Eligibility", "Inclusion", "Exclusion", or "DISEASE CHARACTERISTICS"
Balance Stratified sampling to balance Entailment/Contradiction labels

About

Binary classification benchmark for rule-based reasoning.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages