Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

24 November 2026

25 Pages

SPIRE: A Systematic Protocol for Prompt Engineering Experiments in Information Extraction

and
1
Department of Software Engineering, Faculty of Electronics, Telecommunications and Informatics, Gdansk University of Technology, Narutowicza 11/12, 80-233 Gdansk, Pomorskie, Poland
2
Centre of Informatics Tricity Academic Supercomputer and networK (CITASK), Traugutta 75, 80-221 Gdansk, Pomorskie, Poland
3
Department of Computer Architecture, Faculty of Electronics, Telecommunications and Informatics, Gdansk University of Technology, Narutowicza 11/12, 80-233 Gdansk, Pomorskie, Poland
*
Author to whom correspondence should be addressed.

Abstract

Information extraction (IE) is a fundamental task in natural language processing (NLP), enabling the transformation of unstructured documents into structured representations for computer applications. Despite the rapid advances in large language models (LLMs) and prompt engineering (PE), the experimental evaluation of prompting strategies remains largely ad hoc and lacks a consistent methodological framework. In this paper, we introduce SPIRE (Systematic Protocol for Prompt Engineering Evaluation in Information Extraction), an experimental protocol for designing, conducting, validating, evaluating, and reporting PE experiments for IE tasks. SPIRE integrates design principles, a layered experimental architecture, validation and evaluation procedures, and reporting guidelines into a comprehensive framework for systematic prompt engineering evaluation. The protocol formalizes the complete experimental workflow, from dataset preparation and Ground Truth construction to prompt design, model execution, output validation, quantitative evaluation, and standardized reporting. Its applicability is illustrated through a pilot study evaluating six prompting strategies for information extraction from a single Polish criminal court judgment.

1. Introduction

Nowadays, the widespread digitalization of traditional paper-based documents and workflows has led to an unprecedented growth in the volume and complexity of electronically available documents [1]. For instance, administrative decisions, business contracts, court judgments, statutes, and regulatory documents constitute vast repositories of unstructured textual information that are essential to a wide range of stakeholders. Not surprisingly, efficient access to this information is becoming a critical prerequisite for informed decision-making. However, the sheer volume, complexity, and often highly specialized language of these documents make manual analysis impractical, motivating the development of automated methods for information extraction (IE) [2].
In general, IE aims to identify and structure semantically meaningful information from text [3], transforming unstructured documents into machine-readable representations suitable for analytical tasks [4]. Across different application domains, IE supports a wide variety of extraction tasks. For example, in the legal domain, these include identifying case metadata, legal provisions, participants, judicial decisions, penalties, contractual clauses, and other legally relevant entities and relationships [5,6,7]. Accurate extraction of such information enables document retrieval, large-scale analytics, document comparison, knowledge graph construction, decision support, and intelligent search. These capabilities have made information extraction (IE) one of the fundamental research directions in Natural Language Processing (NLP) [8], with applications spanning domains such as business, healthcare [9], finance [10], law [11], and scientific literature [12].
Recent advances in Large Language Models (LLMs) have substantially expanded the capabilities of automated text analysis [13]. Unlike traditional IE systems that rely on handcrafted rules or task-specific supervised learning models, modern LLMs can understand complex linguistic structures, capture long-range contextual dependencies, and generalize across previously unseen tasks [14]. Their ability to perform multiple language understanding tasks without redesigning the model for each task has fundamentally changed the way IE systems are developed and evaluated [15].
Among the various capabilities enabled by LLMs, prompt engineering (PE) has emerged as one of the most practical approaches for IE [16]. By expressing extraction tasks through natural language instructions rather than task-specific model training, PE enables rapid experimentation, flexible adaptation to new domains, reduced development costs, and faster deployment of IE solutions, ultimately providing users with more efficient access to structured information [17]. These advantages have led to the widespread PE adoption as a primary methodology for analyzing and evaluating the IE capabilities of modern language models.
Moreover, the growing proliferation of LLMs has stimulated extensive research into PE, where the formulation, structure, and content of prompts are systematically modified to improve extraction quality [18]. State-of-the-art studies demonstrate that prompt design can substantially influence extraction performance, often without requiring any modifications to the underlying language model [19]. This has made PE an important research area, attracting considerable attention from both academia and business.
Despite this rapid progress, evaluating PE strategies remains considerably more challenging than evaluating traditional machine learning models [20]. First, existing studies frequently differ in experimental design, dataset preparation, annotation procedures, extraction schemas, evaluation metrics, validation workflows, and reporting practices, making direct comparisons difficult and limiting the reproducibility of published results [21]. Second, as the number of prompting strategies continues to grow, establishing rigorous and reproducible evaluation methodologies becomes important for enabling comparisons and building a reliable body of evidence [22].
The growing adoption of LLMs has resulted in an expanding body of research investigating how prompt design affects their performance across a diverse range of IE tasks. Numerous prompting strategies have been proposed, including expert personas, structured prompts, constraint-based instructions, evidence-grounded prompting, self-reflection mechanisms, and reasoning-oriented approaches [23,24,25]. These studies demonstrate that modifications to prompt formulation can influence information extraction performance. As a result, prompt engineering has become an important area of experimental research in modern NLP [26].
Despite the increasing number of proposed prompting strategies, comparing their effectiveness across studies still remains difficult. Existing evaluations are typically conducted under different experimental conditions, including the use of different language models, domains, document collections, extraction objectives, annotation procedures, prompt formulations, evaluation metrics, and reporting practices. Furthermore, multiple experimental factors often vary simultaneously, preventing differences in reported performance from being unambiguously attributed to the prompting strategy itself.
Nonetheless, the challenge extends beyond prompt formulation alone. The quality of an evaluation is also influenced by the preparation of the reference dataset, the construction of ground truth annotations, the definition of the information extraction schema, the validation of model outputs, and the selection of evaluation metrics. Even studies investigating similar IE tasks typically adopt different annotation guidelines, represent extracted information using incompatible schemas, or evaluate performance using different metrics. As a result, methodological heterogeneity throughout the experimental pipeline can reduce the comparability of published results.
Beyond these considerations, reproducibility presents an additional challenge. Many studies provide only partial descriptions of their experimental procedures, making independent replication difficult. Details regarding prompt construction, annotation protocols, validation procedures, model configuration, and output post-processing are often omitted or only briefly described. Moreover, the absence of standardized reporting practices can prevent researchers from determining whether observed differences in performance originate from PE techniques or from other uncontrolled aspects of the experimental design.
In particular, these limitations are vital in information extraction, where tasks involve complex semantic structures, domain-specific terminology, hierarchical concepts, and context-dependent interpretation. Under such conditions, even minor differences in experimental settings can affect the evaluation outcomes. Having said that, evaluating prompting strategies requires not only carefully designed prompts but also rigorous control over the entire experimental process.
Bearing in mind the aforementioned observations, the current challenge is no longer the lack of prompting techniques but rather the lack of standardized and reproducible evaluation protocols. In addition, as the number of proposed prompting techniques and strategies continues to increase, a common experimental protocol would enable reliable comparisons, facilitate independent replication, and build a reliable body of evidence.
By definition, PE is generally understood as the iterative process of designing and refining natural language instructions to improve the performance of large language models (LLMs). While this perspective emphasizes prompt formulation, it underestimates the experimental nature of PE research. Every evaluation of a prompting strategy constitutes a controlled empirical experiment whose objective is to determine whether a specific modification to a prompt produces measurable and significant changes in model behavior. Accordingly, PE should be regarded not merely as prompt design but as a systematic experimental methodology.
From this perspective, PE experiments should follow the principles similar to those that govern controlled empirical research in other scientific disciplines. Specifically, experimental variables should be explicitly defined, modifications should be rearranged in a controlled manner, evaluation criteria should remain consistent across experimental setups, and the complete experimental procedure should be documented with sufficient detail to enable independent replication. Such methodological rigor aims to ensure that differences in experimental outcomes genuinely reflect the influence of prompt design rather than uncontrolled variation.
The identified issue does not concern the shortage of prompting strategies but rather the absence of a unified experimental protocol that systematically defines how PE experiments should be designed, conducted, validated, evaluated, and reported. Such a protocol would establish a common methodological framework for reducing experimental variability, improving reproducibility, facilitating independent replication, and eventually enabling reliable comparisons between different studies.
Existing reporting guidelines, benchmark methodologies, and PE surveys discuss individual aspects of reproducibility, evaluation, or reporting. However, existing work does not provide a widely adopted unified experimental protocol covering the complete lifecycle of PE experiments. This paper addresses this gap by introducing the SPIRE protocol, a reproducible experimental protocol that standardizes the complete evaluation process. More specifically, the proposed protocol provides the following four contributions:
  • a set of design principles for reproducible PE experiments;
  • a layered experimental architecture integrating dataset preparation, ground truth construction, prompt design, model execution, validation, evaluation, and reporting;
  • a controlled experimental protocol for isolating the influence of individual prompt modifications;
  • a model-independent reference implementation illustrated through information extraction from Polish criminal court judgments, demonstrating how the protocol can be applied in domain-specific information extraction tasks.
SPIRE synthesizes dispersed methodological recommendations into a unified experimental protocol, facilitating reproducible experimentation, supporting independent replication, improving the comparability of results, and providing a practical framework for PE evaluation (see Table 1). More specifically, the protocol formalizes the complete experimental workflow, from dataset preparation and Ground Truth construction to prompt design, model execution, output validation, quantitative evaluation, and standardized reporting. By treating PE as a controlled scientific experiment rather than as an isolated prompt comparison, SPIRE provides a structured methodology for controlling experimental variables and for documenting sources of variability beyond the control of the researcher.
Table 1. Specification of the SPIRE protocol.
The rest of the paper is structured as follows. Section 2 introduces the SPIRE protocol and presents its architecture, design, and associated protocols. Section 3 demonstrates its practical application. Section 4 examines its limitations, while Section 5 discusses its potential applications.

2. Method Details

This section presents SPIRE, a standardized experimental protocol for conducting reproducible prompt engineering (PE) experiments in information extraction (IE) tasks. The protocol defines a complete workflow, from dataset preparation and prompt design to validation, evaluation, and reporting of results.
SPIRE consists of three complementary components. First, a set of design principles establishes the methodological foundations of the protocol. Second, an experimental architecture organizes the complete evaluation workflow. Third, standardized operational procedures define how each stage of the experiment should be performed.
Note that the separation of conceptual design principles from operational procedures enables controlled comparisons of PE strategies and improves the reproducibility of experimental studies. This design makes the protocol model-independent, task-independent, and domain-independent. As a result, it can be applied to different language models, application domains, document collections, and information extraction tasks.

2.1. Design Principles

SPIRE is founded on a set of design principles that establish the methodological requirements for conducting reproducible PE experiments. Rather than prescribing individual implementation choices, these principles define the fundamental characteristics that the protocol and its constituent components should satisfy.
The design principles were synthesized from recommendations introduced in previous studies on reproducible experimentation, benchmark construction, information extraction evaluation, prompt engineering, and reporting standards. In this vein, Table 2 presents the seven principles along with motivation and supporting references.
Table 2. Design principles underlying the SPIRE protocol and their rationale.
This set of principles establishes the methodological foundation of SPIRE. It guides the design of each protocol component. The following section presents a layered experimental architecture that implements these principles and structures the research workflow.

2.2. Experimental Architecture

SPIRE is organized as a layered experimental architecture that translates the design principles into a structured experimental workflow. Each layer is responsible for a specific methodological component. Unlike the operational layers that define individual stages of the workflow, the Design Principles constitute the conceptual foundation governing the entire framework. The layered architecture operationalizes these principles by specifying the responsibilities of each layer and their interactions throughout the evaluation process. As illustrated in Figure 1, the architecture consists of a sequence of operational layers that organize SPIRE protocol.
Figure 1. Layered architecture of the SPIRE protocol.
Starting from the top, the Experimental Design Layer establishes the overall experimental configuration by defining the research objectives, comparison strategy, and experimental variables. It is supported by three complementary foundation layers that establish the experimental foundation of the protocol.
The Dataset Layer specifies the evaluation corpus. The Ground Truth Layer defines the reference annotations against which generated outputs are evaluated. The Prompt Layer specifies the prompting strategies to be compared under predefined experimental conditions. Since these layers provide the inputs for all subsequent stages, they must be specified before model execution begins.
Once the experimental foundation is defined, the protocol proceeds to the execution and assessment stages. The Model Execution Layer governs the interaction between the prepared inputs and the selected language model. The Validation Layer verifies that generated outputs satisfy the predefined validation requirements, including data syntax, schema compliance, data format validity, and hallucination assessment.
The Evaluation Layer measures the semantic correctness of the extracted information using predefined evaluation metrics and error analysis procedures.
Finally, the Reporting Layer standardizes the presentation of experimental settings, validation outcomes, evaluation results, identified limitations, and other artifacts. This layer facilitates the interpretation, comparison, and independent replication of the reported study.

2.3. Experimental Design

The Experimental Design Layer defines the conditions used to compare prompt configurations and identifies which sources of variation the experimenter can control. The protocol follows the One-Factor-at-a-Time (OFAT) principle. The prompt configuration is the factor intentionally varied. The task, evaluation corpus, reference annotation, accessible execution settings, and evaluation procedures are held constant across conditions.
Next, the protocol identifies three categories of variables: independent, dependent, and controlled:
  • Independent variable: the prompt design under investigation, with individual prompting strategies or prompt configurations representing its levels.
  • Dependent variables: the evaluation metrics used to assess information extraction performance.
  • Controlled variables: all remaining components under the researcher’s control, including the evaluation corpus, annotation guidelines, extraction schema, accessible model settings, validation procedures, and reporting format.
In summary, this structure guides the design, implementation, and evaluation of prompting strategies.

2.4. Dataset Protocol

The Dataset Protocol defines the evaluation corpus used throughout the experiment. All prompting strategies are evaluated using the same collection of documents, which remains unchanged throughout the experiment. This ensures that observed differences in extraction performance cannot be attributed to changes in the underlying data.
By design, the protocol is independent of any application domain or document type. The evaluation corpus should consist of any textual resource that supports the research objectives. Domain-specific characteristics affect only the corpus content and do not alter the protocol itself. Each document should receive a unique identifier and descriptive metadata to ensure traceability. Additional metadata, such as document type, jurisdiction, publication date, language, or document length, should be included when relevant to the research objectives.
The dataset specification should be documented as part of the experimental artifacts. It should describe the document source, inclusion and exclusion criteria, corpus composition, metadata structure, preprocessing procedures, and dataset organization to support independent replication. In this vein, documents should be converted into a machine-readable text representation before evaluation. Any preprocessing is completed before the evaluation corpus is finalized. After finalization, no documents should be added, removed, reordered, or modified.

2.5. Ground Truth Annotation Protocol

The Ground Truth Protocol establishes the reference annotations against which the outputs generated by the evaluated prompting strategies are assessed. Its primary objective is to provide an objective and consistent representation of the information to be extracted from each document. Since quantitative evaluation depends directly on the quality of the reference annotations, Ground Truth construction is a critical stage of the protocol.
Ground Truth annotations are prepared before prompt construction and model execution. Once finalized, they remain unchanged throughout the experiment to ensure that all prompting strategies are evaluated against the same reference annotations. They should follow predefined annotation guidelines that specify the extraction fields, interpretation rules, treatment of ambiguous cases, representation of missing information, and controlled vocabularies where applicable. Defining these guidelines before annotation begins reduces subjectivity and facilitates annotation consistency.
The protocol recommends restricting Ground Truth to information explicitly stated in the source documents. Reference annotations should avoid subjective interpretation, reasoning beyond the document content, or assumptions unsupported by textual evidence. Whenever a required information item is not explicitly available, the corresponding field should be represented using a predefined null value rather than inferred by the annotator. If revisions become necessary during protocol development, version control should document all modifications before the reference annotations are finalized.

2.6. Information Extraction Schema

The Information Extraction Schema defines the structure of the information extracted from each document. It provides the common representation used by Ground Truth annotations, model outputs, and quantitative evaluation, ensuring that all protocol stages operate on the same data structure. The schema is defined before annotation begins and remains unchanged throughout the experiment. Both the reference annotations and model outputs conform to the same schema so that observed differences in extraction performance reflect prompt design rather than inconsistencies in data representation.
The schema consists of predefined extraction fields aligned with the research objectives. Each field includes a semantic definition and, where applicable, admissible values, data types, formatting rules, controlled vocabularies, and output constraints. This formal specification reduces ambiguity. Extraction fields should represent information explicitly stated in the source documents. Fields requiring subjective interpretation or reasoning beyond the available evidence should be avoided whenever possible. Missing information should be represented using a predefined null value applied consistently throughout annotation and evaluation.
The complete extraction schema should be documented as part of the experimental artifacts, including field definitions, data types, admissible values, null representations, and annotation examples. This documentation supports independent replication and comparison of experimental results. SPIRE does not prescribe a particular extraction schema. The number and semantics of extraction fields depend on the application domain and research objectives, but the selected schema remains unchanged throughout the experiment.

2.7. Prompt Engineering Protocol

The Prompt Engineering Protocol defines how to construct and evaluate prompt configurations. All prompting strategies operate under the same experimental configuration, with prompt design representing the only intentionally varied component of the experiment.
First, define the prompt templates. Each template should clearly specify the extraction task, the expected output structure, how to handle missing information, and any formatting requirements needed for subsequent validation and evaluation.
Next, define the prompting strategies using these templates. Before model execution, document each strategy by recording its complete prompt template, task instructions, formatting requirements, constraints, and any additional guidance provided to the language model. Include the complete prompt specifications and any model-specific execution parameters needed to reproduce the experiment in the experimental artifacts. Once finalized, the prompt definitions remain unchanged throughout the experiment.
SPIRE does not prescribe a particular prompting technique. Any strategy consistent with the research objectives can be evaluated such as basic prompting, persona-based prompting, structured output prompting, constraint-based prompting, few-shot prompting, evidence-based prompting, or other approaches.

2.8. Model Execution Protocol

The Model Execution Protocol defines how prompting strategies are executed using large language models. Its objective is to minimize variability arising from model execution. The model, model version, inference parameters, and execution environment should be held constant across prompting strategies to the extent that these settings can be controlled. The execution configuration should document the model identifier and version, the execution environment (e.g., a web interface, API, or local deployment), the execution date, and the available inference settings, including temperature, sampling configuration, random seed, and output token limit where applicable.
For platform-managed parameters, the protocol calls for reporting verifiable values and identifying details that cannot be verified, including the exact backend model snapshot if it is undisclosed. Holding controllable settings constant makes differences in extraction performance across prompting strategies that are easier to interpret.
Each document in the evaluation corpus should be processed independently under each prompting strategy. Each execution should use one document and one strategy. The complete model input should be assembled by filling the predefined prompt template with the source document and any other required inputs, such as the shared extraction schema. The prompt should instruct the model to return a response that conforms to the predefined information extraction schema. The original response should be passed to validation and evaluation without manual correction or post-processing.
The protocol can be applied to proprietary or open-source models accessed through web interfaces or remote APIs, or run locally. Each original model response should be stored as an immutable experimental artifact together with the document identifier, prompting strategy, execution configuration, and timestamp. These records support later validation, evaluation, error analysis, and independent verification.

2.9. Validation Protocol

The Validation Protocol verifies whether generated outputs satisfy the technical requirements necessary for reliable quantitative evaluation. Unlike the Evaluation Protocol, which measures semantic correctness with respect to the Ground Truth, the Validation Protocol focuses on structural integrity, data consistency, and factual grounding. Responses that fail a validation stage should be retained as original artifacts and handled according to a predefined failure rule. Invalid outputs should be excluded, but their validation failure must be reported.
The Validation Protocol consists of three sequential stages. Each stage is performed only after the preceding stage has been completed successfully. The first stage, JSON Validity, verifies that the generated output is syntactically valid JSON. Validation is performed using a standard JSON parser. The outcome is binary:
  • PASS (1)—the generated output is valid JSON.
  • FAIL (0)—the generated output is not valid JSON.
No additional metric is required.
The second stage, Schema Validity, verifies that the parsed JSON conforms to the information extraction schema. This includes the presence of all required fields, the correct hierarchical organization of objects and arrays, expected data types, value constraints, lexical formats, identifier patterns, controlled vocabularies, enumerated values, and other application-specific validation rules. The outcome is also binary:
  • PASS (1)—the output conforms to the schema.
  • FAIL (0)—one or more schema violations are detected.
Since the outcome is binary, no additional metric is required.
The third stage, Hallucination Assessment, determines whether each extracted item is explicitly supported by the source document using a deterministic source-grounding procedure (DSGP). The resulting classifications are summarized using the Hallucination Rate (HR).
The DSGP determines whether each extracted item is supported by the source document. Primitive extracted items (e.g., identifiers, names, dates, numbers, and short textual values) are evaluated directly. Long textual claims are evaluated using a similarity measure, whereas structured objects are decomposed into atomic claims.
For long textual claims, a claim is considered supported if its similarity score satisfies
S ≥ T text ,
where S denotes the similarity score between the extracted claim and the best-matching source segment.
The protocol does not prescribe a specific similarity measure. Any normalized similarity function may be used, provided that it produces scores comparable with the threshold Ttext. Possible choices include normalized edit distance, token-based similarity measures, Jaccard similarity, cosine similarity, embedding-based similarity, and other domain-specific similarity measures.
For structured objects, an extracted item is considered supported if
N s N a ≥ T cov ,
where N s is the number of supported atomic claims, N a is the number of assessable atomic claims, and T cov denotes the minimum support coverage threshold.
An extracted item is classified as supported if it satisfies the applicable deterministic source-grounding criterion. Specifically,
Supported ⟺ S ≥ T text , for primitive items and long textual claims , N s N a ≥ T cov , for structured objects .
Otherwise, the item is classified as hallucinated.
Let N h denote the number of hallucinated extracted items and let N e denote the total number of non-null extracted items. The Hallucination Rate (HR) is defined as
H R = N h N e .
The Hallucination Rate ranges from 0 to 1, where HR = 0 indicates that all extracted items are supported by the source document and HR = 1 indicates that none are supported. If no non-null items are extracted, HR is reported as undefined.
The denominator includes only non-null extracted items rather than all fields defined in the schema. Otherwise, hallucination severity could be underestimated when only a small number of items are extracted. For example, if two items are extracted and one is unsupported, then HR = 0.5 regardless of the total number of schema fields.
To sum up, these three validation stages verify JSON syntax, schema compliance, and factual grounding before quantitative evaluation.

2.10. Evaluation Protocol

The Evaluation Protocol specifies the procedures used to assess the quality of the validated outputs generated by different prompting strategies. Its primary objective is to provide a standardized framework for comparing experimental conditions using a common set of quantitative evaluation criteria. By ensuring that all prompt designs are evaluated according to identical procedures, the protocol enables reproducible performance comparisons.

2.10.1. Object Alignment and Matching

Information extraction frequently produces collections of structured objects rather than individual scalar values. For example, in the legal domain, fields such as participants, charges, legal provisions, penalties, and legal measures typically contain multiple structured objects in both the Ground Truth and the predicted output. Since the ordering of objects generated by large language models cannot be assumed to correspond to the ordering of the reference annotations, evaluation requires an explicit alignment procedure before object-level comparison can be made.
Object alignment establishes candidate correspondences between predicted and Ground Truth objects. The selected matching strategy determines whether and how aligned object pairs are considered matches. Object alignment is performed independently for each information extraction field containing structured objects. In contrast, scalar fields (e.g., case_number, court, or judgment_date) are compared directly and do not require an alignment stage.
SPIRE does not prescribe a specific alignment algorithm. Instead, any deterministic alignment procedure that establishes a unique one-to-one correspondence between predictions and reference objects could be applied. Possible approaches include exact identifier matching, similarity-based assignment, optimal bipartite matching, or other application-specific alignment techniques.
Following object alignment, each aligned object pair is evaluated according to the selected matching strategy. For object-level matching, aligned object pairs that satisfy the selected matching criterion are classified as True Positives (TP). If an aligned object pair fails the selected object-level matching criterion, the predicted object contributes one False Positive (FP), and the corresponding Ground Truth object contributes one False Negative (FN).
The object-level classification can be summarized as follows:
  • Matching pair → True Positive (TP);
  • Unaligned prediction → False Positive (FP);
  • Unaligned Ground Truth object → False Negative (FN);
  • Aligned but non-matching pair → False Positive (FP) + False Negative (FN).
Under Attribute Match, aligned objects remain paired, and TP, FP, and FN are computed independently for each corresponding attribute rather than for the object as a whole. An object may contribute both True Positives (TP) and False Positives (FP) or False Negatives (FN) at the attribute level. True Negatives (TN) are not defined because the space of non-extracted information is effectively unbounded in information extraction tasks.
SPIRE supports multiple matching strategies according to the desired level of comparison. Exact Match requires complete equality between a predicted object and its corresponding reference object. Attribute Match evaluates individual attributes within aligned object pairs, allowing agreement to be assessed at the attribute level rather than requiring complete object equality. Soft Match considers two values to match when their semantic or textual similarity exceeds a predefined threshold.

2.10.2. Evaluation Metrics

The evaluation metrics quantify different aspects of information extraction performance and enable objective comparison between prompting strategies. Unless stated otherwise, all metrics are computed using the numbers of True Positives (TP), False Positives (FP), and False Negatives (FN).
Scalar Accuracy (SA) measures the proportion of scalar information extraction fields that are predicted correctly. It is defined as
S A = N c N s
where N c denotes the number of correctly predicted scalar fields and N s denotes the total number of evaluated scalar fields.
Scalar Accuracy is applicable only to scalar fields that contain a single value (e.g., case_number, court, or judgment_date). Since these fields do not contain collections of structured objects, their evaluation does not require object alignment and is based solely on direct comparison with the corresponding Ground Truth values.
Field Exact Match Accuracy (FEMA) measures the proportion of information extraction fields that are extracted perfectly. A field is considered correct only if all extracted items satisfy the selected matching criterion and no False Positives or False Negatives are present. The metric is defined as
F E M A = N ef N f ,
where N ef denotes the number of extraction fields that are matched perfectly, and N f denotes the total number of evaluated extraction fields.
For scalar fields, a perfect match is achieved when the predicted value is identical to the corresponding Ground Truth value. For structured fields, a perfect match requires that all predicted objects match their corresponding Ground Truth objects according to the selected matching strategy.
Precision measures the proportion of correctly extracted items among all items produced by the model. It is defined as
P r e c i s i o n = T P T P + F P
By definition, a high Precision indicates that the model rarely produces incorrect extractions.
Recall measures the proportion of Ground Truth items successfully extracted by the model. It is defined as
R e c a l l = T P T P + F N
Inherently, a high Recall indicates that the model successfully identifies most relevant information contained in the reference annotations.
The F1-score combines Precision and Recall into a single performance measure by computing their harmonic mean:
F 1 = 2 · P r e c i s i o n · R e c a l l P r e c i s i o n + R e c a l l
By construction, the F1-score achieves its highest value when both Precision and Recall are simultaneously high and decreases whenever one of these measures deteriorates.

2.10.3. Micro- and Macro-Averaging

Typically, information extraction tasks involve multiple extraction fields with different numbers of instances. The extraction system performance could be summarized using either micro-averaging or macro-averaging.
The micro-averaging aggregates the numbers of True Positives, False Positives, and False Negatives across all evaluated fields before computing the evaluation metric. As a result, fields containing many instances contribute proportionally more to the final score.
Micro-averaged Precision is defined as
Precision micro = ∑ i T P i ∑ i T P i + ∑ i F P i
where the summation is performed over all information extraction fields.
Micro-averaged Recall is defined as
Recall micro = ∑ i T P i ∑ i T P i + ∑ i F N i .
The micro-averaged F1-score is the harmonic mean of micro-averaged Precision and Recall:
F 1 micro = 2 · Precision micro · Recall micro Precision micro + Recall micro .
The Macro-averaging computes the evaluation metric independently for each extraction field and subsequently calculates the arithmetic mean across all fields. As a result, every extraction field contributes equally to the final performance measure, regardless of the number of extracted items it contains.
Macro Precision is defined as
P r e c i s i o n macro = 1 K ∑ i = 1 K P r e c i s i o n i
where K denotes the total number of evaluated extraction fields.
Macro Recall is defined as
R e c a l l macro = 1 K ∑ i = 1 K R e c a l l i
Similarly, the Macro F1-score is computed as
F 1 , macro = 1 K ∑ i = 1 K F 1 , i
where F 1 , i denotes the F1-score obtained for the i-th extraction field.
Precision, Recall, and the F1-score may be reported using either micro- or macro-averaging. Micro-averaging summarizes the overall extraction performance by assigning equal importance to every extracted item, whereas macro-averaging summarizes performance across information extraction fields by assigning equal importance to each field. The choice of aggregation strategy depends on the objectives of the evaluation.
Beyond quantitative performance measures, the protocol recommends conducting systematic error analysis to identify recurring extraction failures and characterize their underlying causes. Errors may arise from incorrect extraction, omission of relevant information, hallucinated content, ambiguous document formulations, or misunderstanding of prompt instructions.
Note that the complete evaluation methodology should be also documented together with the selected metrics, aggregation procedures, error categorization scheme, and software used to facilitate reproducibility and comparison.

2.11. Reporting Protocol

The Reporting Protocol defines the information that accompanies published experimental results. Its objective is to ensure that experiments can be understood, reproduced, and compared across independent studies.
Every study should document the complete configuration and research settings, including the research objective, experimental design, dataset specification, annotation guidelines, information extraction schema, prompting strategies, language model configuration, validation procedures, evaluation methodology, and performance metrics.
Whenever legally and ethically permissible, the experimental artifacts should also be published. These artifacts might include the evaluation corpus or its description, annotation guidelines, Ground Truth annotations, prompt templates, validation rules, evaluation scripts, and aggregated results. When the original documents cannot be shared, sufficient metadata should be provided to support the construction of an equivalent evaluation corpus.
Beyond reporting quantitative performance measures, reports should also discuss study-specific decisions, identified limitations, and potential threats to validity. Such information provides valuable context for interpreting the obtained results.

3. Illustrative Use Case

This section demonstrates the practical application of the proposed experimental protocol through an illustrative case study involving information extraction from one Polish court judgment. The objective of this example is not to optimize prompting strategies or compare language models but to illustrate how each component of the protocol can be implemented within a real experimental setting.
The presented use case follows all stages of the proposed protocol, including experimental design, dataset preparation, ground truth construction, annotation, information extraction schema definition, prompt engineering, model execution, validation, evaluation, and reporting. Although the experimental configuration is specific to legal information extraction from criminal court judgments, the protocol itself remains independent of the application domain and may be adapted to other application domains, document types, and information extraction tasks.
The following subsections describe how each layer of the proposed protocol was implemented in the presented study while preserving the methodological principles (see Section 2.1).

3.1. Experimental Setting

The pilot applied SPIRE to information extraction from a single Polish criminal court judgment (J0001). The objective of the study was not to identify the best-performing prompting strategy or language model but to demonstrate how the proposed protocol can be systematically applied to design, execute, and evaluate a reproducible prompt engineering (PE) experiment.
The experimental workflow followed all stages defined by the proposed protocol. First, the research objective and experimental variables were established according to the Experimental Design Protocol. The evaluation dataset was prepared, annotation guidelines were developed, and ground truth annotations were created using a predefined information extraction schema. A set of prompting strategies was then constructed and executed using the same visible model selection and interface mode. The generated outputs were validated against the predefined schema before being evaluated quantitatively using the reference annotations. Finally, the evaluation configuration and results were documented according to the proposed Reporting Protocol.
The experiment followed the One-Factor-at-a-Time (OFAT) principle (see Section 2.3). The prompting strategy was the only factor deliberately changed across runs. All six runs used the same source judgment, extraction schema, and user-controlled interface settings. Next, all six responses were evaluated against the same reference annotation using the same validation procedures and scoring rules.
Although the application domain is specific to legal information extraction, the presented implementation serves solely as an example of how the proposed protocol can be instantiated in practice. The protocol itself remains independent of the document type, legal domain, language, or jurisdiction and may therefore be applied to other legal information extraction tasks.

3.2. Dataset Preparation

The evaluation dataset for this pilot consisted of one Polish criminal court judgment from the Polish Courts Judgments Portal. The judgment was issued by the District Court in Olsztyn on 29 September 2017 (case no. VII K 355/17) and included a written justification. It was assigned the identifier J0001 and stored as a plain-text file. A separate metadata record linked this identifier to the case number, court, court division, judgment date, case type, document length, and annotation status.
The same judgment text was used to prepare the reference annotation manually, run all six prompting strategies, and assess whether the extracted information in each saved response was supported by the source.

3.3. Ground Truth Construction

Following the Ground Truth Protocol and the Annotation Protocol (see Section 2.5), reference annotations were manually constructed for the judgment included in the evaluation corpus. The objective of this process was to establish an unbiased reference standard that could be used for the quantitative evaluation of all prompting strategies.
Annotation guidelines were developed before the annotation process commenced. These guidelines defined the information to be extracted from each judgment, specified interpretation rules for every extraction field, described the treatment of missing information, and established consistent annotation conventions for ambiguous cases. The guidelines remained unchanged throughout the experiment to ensure that the document was annotated according to identical criteria.
The annotation process was performed exclusively on the basis of information explicitly contained in the judicial decisions. No external legal knowledge, assumptions, or interpretations extending beyond the document content were incorporated into the reference annotations. Whenever a required information item was not explicitly available in a judgment, the corresponding extraction field was assigned the predefined null representation defined in the annotation guidelines.
Each annotated judgment was linked to its unique document identifier and stored using the predefined information extraction schema described in the following section. This organization ensured complete traceability between the original document, the corresponding ground truth instance, and the outputs generated by the evaluated prompting strategies.
Once the annotation process had been completed and internally verified, the resulting reference annotations were frozen and remained unchanged throughout the remainder of the experiment. The finalized reference annotation was used for quantitative extraction scoring and qualitative error analysis.

3.4. Information Extraction Schema

Following the Information Extraction Schema (see Section 2.6), a task-specific schema was defined to support structured information extraction from Polish criminal court judgments. The schema served as the common representation shared by the annotation process, the ground truth, the language model outputs, and the quantitative evaluation. As a result, every stage of the experimental workflow operated on an identical data structure.
Note that the schema was designed to capture the essential information typically contained in criminal court judgments while maintaining a balance between practical applicability and annotation consistency. Only information explicitly stated in the judgments was included in the schema, avoiding fields requiring subjective legal interpretation or external domain knowledge. Such a design reduced annotation ambiguity and improved the reproducibility of the evaluation.
Each extraction field was assigned a unique identifier together with a precise semantic definition specifying the expected content. Whenever appropriate, field definitions also included formatting conventions and predefined representations for unavailable information. These specifications ensured that both manual annotations and language model outputs followed identical structural requirements throughout the experiment.
The final schema consisted of eleven extraction fields describing the principal elements of a criminal court judgment. Table 3 presents the field identifiers, field names, expected data types, and semantic definitions.
Table 3. Information extraction schema used in the illustrative use case.
Note that the predefined information extraction schema remained unchanged throughout the study and constituted the reference structure for all evaluated prompting strategies.

3.5. Prompting Strategies

A fixed set of prompting strategies was defined according to the Prompt Engineering Protocol (see Section 2.7) to demonstrate its practical application. All strategies were evaluated using the same task, source document, extraction schema, and evaluation procedure. The prompting strategy was the only factor deliberately changed across runs.
In total, six prompting strategies were developed, namely: Zero-Shot, Expert Persona, Structured Output, Constraint-Based, Evidence-Based, and Self-Review. These strategies represent distinct prompt design approaches while remaining compatible with the proposed experimental protocol. Table 4 presents the evaluated strategies.
Table 4. Prompt engineering strategies evaluated in the illustrative use case.
Each strategy is defined by a prompt template with placeholders for the shared schema (prediction.schema.json) and the judgment text (J0001.txt). The archived templates document the instructions specific to each configuration.

3.6. Experimental Execution

The pilot followed the Model Execution Protocol (see Section 2.8). Each prompting strategy was run once in a separate Temporary Chat session with ChatGPT 5.5 selected in the interface. Each input combined the strategy-specific instructions, the shared extraction schema, and the text of J0001. The exact backend model snapshot and platform-managed inference parameters, including temperature and sampling configuration, could not be independently verified.
This design provides one saved response per strategy and yields no estimate of within-strategy variability or output stability across repeated executions. For each prompt strategy execution, the complete prompt template was combined with the corresponding source document and submitted to the language model. The generated response was required to follow the predefined information extraction schema. No manual corrections or post-processing operations were applied to the model outputs.
The deposited files link the six saved responses to the judgment identifier and their corresponding prompting strategies. The archived evaluator regenerates the scores from these responses. All outputs were preserved in their original form and stored as immutable experimental artifacts for automatic validation, quantitative evaluation, qualitative error analysis, and manual verification of the reported results.

3.7. Validation Protocol

Before matching an extracted claim against the source text, both texts are normalized for Unicode representation, whitespace, and punctuation. This normalization reduces the effect of formatting differences. Exact matching is attempted first. If exact matching fails for a long textual claim, the deterministic source-grounding procedure (DSGP) computes a normalized similarity score S (see Section 2.9). At this stage, a candidate passage is accepted as support for the claim if S ≥ T text , where T text = 0.72 . This threshold allows for minor lexical and morphological differences. Lowering the threshold allows less similar passages to support the claim.
An extracted object is classified as supported if at least 80% of its assessable atomic claims are supported by the source judgment ( T cov = 0.80 ). Each assessable claim contributes equally to the coverage score, so an object may meet the threshold even if some of its claims are unsupported. Null values, empty strings, and Boolean values are excluded from the set of assessable claims. An object with no assessable claims is classified as unsupported.
Both thresholds were used as heuristic settings in the pilot. Their effect on the reported results was not assessed through independent calibration or a systematic sensitivity analysis.

3.8. Evaluation Protocol

The proposed evaluation protocol was implemented in Python v3.14 using a deterministic object alignment procedure. The implementation follows the evaluation pipeline (see Section 2.10), beginning with structural validation of the generated JSON document, followed by hallucination assessment, object alignment, matching, confusion matrix construction, computation of evaluation metrics, and automatic generation of a comprehensive evaluation report.
The implementation computes evaluation metrics separately for each supported matching strategy. In our study, two complementary sets of performance metrics are reported. The first is based on Exact Match, where a predicted object is considered correct only if it is identical to the corresponding Ground Truth object. The second is based on Attribute Match, where correctness is determined at the attribute level, allowing partial credit for correctly extracted object attributes.
Object alignment is implemented by first computing a pairwise similarity matrix between all predicted and Ground Truth objects within each structured information extraction field. The resulting similarity matrix is used to establish a one-to-one correspondence between predicted and Ground Truth objects by solving an optimal bipartite assignment problem. Object pairs whose similarity score is at least 0.25 are considered aligned and are forwarded to the matching stage.
The evaluation settings can be changed without modifying the source code. Soft Match is optional and was enabled for all reported runs. It uses a heuristic string-similarity threshold of 0.90 for eligible text comparisons during object alignment and attribute scoring. Exact Match requires equality after canonicalization.
For Exact Match, micro- and macro-averaged F1 are computed over collection fields. For Attribute Match, both averages also include scalar fields. Micro F1 is computed from the pooled counts of true positives, false positives, and false negatives. Macro F1 is the arithmetic mean of the field-level F1 scores that are defined for the strategy being evaluated.

3.9. Reporting Protocol

To facilitate reproducible experiments, all evaluation parameters, including the selected matching strategy, similarity thresholds, and hallucination assessment settings, are recorded together with the generated evaluation results. Upon completion of the evaluation process, the software automatically produces a detailed evaluation report containing the validation outcomes, hallucination assessment, object alignment statistics, confusion matrix values, field-level evaluation results, aggregated evaluation metrics, and an interpretation of the obtained results. The generated report provides a complete and reproducible summary of the evaluation process for each prompting strategy.

3.10. Results

The pilot demonstrates how SPIRE can be used to compare prompting strategies on the same extraction task. For the six saved responses to J0001, the validation results and extraction scores address RQ1 and RQ3, respectively. For RQ2 and RQ4, this section outlines the procedures needed to answer these questions in future experiments involving multiple judgments.

3.10.1. Validation Results

Before assessing the extraction quality of the evaluated prompt engineering strategies, all generated outputs were subjected to the validation procedure defined in the proposed protocol. The objective of this stage was to verify whether the responses satisfied all validation requirements necessary for reliable quantitative evaluation. Table 5 presents the validation results obtained for the six evaluated strategies.
Table 5. Validation results obtained for the evaluated prompt engineering strategies. Bold values indicate the best results.
The validation results indicate that all evaluated prompt engineering strategies generated syntactically correct and structurally compliant outputs. Every strategy achieved perfect JSON Validity and Schema Validity scores (1.0). This demonstrates that all generated responses conformed to the predefined information extraction schema. As a result, all strategies satisfied the structural validation requirements of the proposed SPIRE protocol and were eligible for subsequent quantitative evaluation.
For RQ1 (Which prompt engineering strategy is the most effective at preventing hallucinations?), Expert Persona (S2), Evidence-Based (S5), and Self-Review (S6) tied for the lowest observed hallucination rate (0.000) on judgment J0001. The deterministic source-grounding procedure flagged 0 of 33, 0 of 31, and 0 of 33 items, respectively. Structured Output (S3) and Constraint-Based Prompting (S4) each had one item flagged, yielding rates of 0.026 (1 of 38) and 0.030 (1 of 33), respectively. The zero-shot baseline (S1) had the highest observed rate of 0.139 (5 of 36).
The zero-shot baseline had a higher proportion of flagged items than each configuration that provided additional instructions. This pattern suggests that additional prompt guidance may help reduce unsupported extraction. Testing that explanation requires additional judgments and repeated runs for each strategy.
The validation results indicate that structural correctness alone does not guarantee semantic reliability. Although every evaluated strategy produced syntactically valid and schema-compliant outputs, noticeable differences were observed in the amount of unsupported information generated. More importantly, these findings confirm the importance of incorporating hallucination assessment as an integral component of the SPIRE validation protocol before conducting semantic performance evaluation.
RQ2 (Are the observed differences in hallucination rates between prompting strategies statistically significant?) requires evaluation on multiple judgments, with each judgment processed under all strategies. A future study could compare document-level hallucination rates using a Friedman test followed by pairwise Wilcoxon signed-rank tests with Holm correction, provided that the assumptions of the tests are met. The present pilot provides only one matched set of document-level rates, corresponding to judgment J0001.

3.10.2. Evaluation Results

For RQ3 (Which prompt engineering strategy achieves the highest information extraction performance?), Expert Persona Prompting (S2) achieved the highest scores on three of the four aggregate F1 measures for J0001: Exact Match Micro F1 (0.5263), Exact Match Macro F1 (0.2808), and Attribute Match Micro F1 (0.7800), as shown in Table 6. Structured Output Prompting (S3) achieved the highest reported Attribute Match Macro F1 (0.7609) and shared the highest Field Exact Match Accuracy (FEMA) with Constraint-Based Prompting (S4). All six strategies correctly extracted four of the five scalar fields, yielding a Scalar Accuracy (SA) of 0.80.
Table 6. Overall extraction scores for the six prompting strategies on judgment J0001. Bold values indicate the highest score for each metric where scores differed across strategies.
S3 and S4 matched the reference annotation exactly in 5 of the 11 evaluated fields (45.45%), compared with 4 of 11 fields (36.36%) for each of the other four strategies. The additional exact match came from the penalty field. S3 and S4 correctly returned an empty collection, whereas each of the other four responses contained two penalty objects. With this field excluded, all six strategies matched the reference exactly in 4 of the remaining 10 fields.
The object-level Exact Match scores explain how S2 could lead on both Micro F1 and Macro F1 while scoring below S3 and S4 on FEMA. A correctly extracted object counts as a match even if another object in the same collection is missing, additional, or incorrect. FEMA requires the entire field to match. The S4 and S5 responses also illustrate the distinction between extraction accuracy and source grounding. Both scored below S2 on Exact Match, although the source-grounding procedure flagged only one item for S4 and none for S5. An extracted item can be supported by the judgment and still differ from its reference annotation.
For all six responses, both Micro F1 and Macro F1 were higher under Attribute Match than under Exact Match. For Self-Review Prompting (S6), for example, Micro F1 was 0.7576 under Attribute Match and 0.4211 under Exact Match. Two differences between the metrics affect the interpretation of this gap. Attribute Match gives credit for correctly extracted attributes within partially matched objects and includes scalar fields in its aggregate scores. Exact Match F1 is computed over collection fields and requires each object to match in full. Identifying which errors involved incorrect attributes, missing objects, or additional objects would require examining the individual predictions.
The highest reported Attribute Match Macro F1, obtained by S3, also depends on how the macro average handles undefined field scores. For S3 and S4, the reference and predicted penalty collections were both empty, so F1 was undefined, and the field was omitted from the average. For each of the other four responses, the two predicted penalty objects counted as false positives, giving the field an F1 of zero. The reported macro average thus covered 10 fields for S3 and S4 and 11 fields for the other strategies. Averaging over the same 10 fields after excluding penalty for every strategy gives approximately 0.8098 for S2, compared with 0.7609 for S3.
Table 7 shows that all six responses matched the same four scalar reference fields: case_number, court, court_division, and judgment_date. None matched the reference value for case_type.
Table 7. Field-level Attribute Match F1 for the six prompting strategies on judgment J0001. Bold values indicate the highest score in rows where the defined scores differed. N/A indicates an undefined F1.
Among the nonempty collection fields, S2 achieved the highest F1 for participants (0.8571), followed by Evidence-Based Prompting (S5) at 0.8000. S6 had the lowest score for this field (0.4286). For charges, five strategies scored 0.8750, while S3 scored 0.7368. For court_decision, S1, S2, S3, and S6 each scored 0.7931, followed by S4 (0.5172) and S5 (0.4314).
The largest difference between the highest and lowest field-level F1 occurred for legal_provisions. S1, S2, and S6 shared the highest score (0.8276), followed by S3 (0.7879), while S4 and S5 each scored 0.3448. For legal_measures, S2 and S6 shared the highest score (0.7451). Across the five nonempty collection fields, S2 ranked first outright for participants and shared the highest score for each of the other four. This field-level result supports the finding that S2 led on three aggregate F1 measures in the six saved responses to J0001, with one execution per strategy.
RQ4 (Are the observed differences in information extraction performance between prompting strategies statistically significant?) requires a future multi-document study. A paired comparison can use one extraction score per judgment and strategy, for example, Attribute Match Micro F1, with the judgment as the unit of analysis. A suitable analysis could use a Friedman test followed by pairwise Wilcoxon signed-rank tests with Holm correction when their assumptions are met.

4. Discussion

The pilot study illustrates how the choice of evaluation metric affects the comparison of prompting strategies. Exact Match requires complete agreement between a predicted object and its reference counterpart. Attribute Match gives credit for correctly extracted attributes and includes scalar fields in its aggregate scores. For J0001, Expert Persona Prompting (S2) achieved the highest Exact Match Micro F1, Exact Match Macro F1, and Attribute Match Micro F1. Structured Output Prompting (S3) and Constraint-Based Prompting (S4) tied for the highest Field Exact Match Accuracy (FEMA) because they were the only strategies to correctly return an empty penalty collection. Each of the six strategies exactly matched the reference annotation in four of the remaining ten fields.
Each of the six prompting strategies was run once on judgment J0001 in a separate Temporary Chat session. The shared resources allow readers to recompute the source-grounding and extraction scores for the six saved responses. With only one response per strategy, the study could not assess how much the output would vary across repeated runs under the same visible settings. The ChatGPT interface did not provide enough information to verify the exact backend model snapshot or platform-managed inference parameters such as temperature and sampling configuration. Whether the observed differences between strategies persist across judgments remains an open question.
The extraction scores also depend on the quality of the manually constructed reference annotation. Producing a reliable annotation requires domain expertise and substantial manual effort. An omitted object or an incorrectly assigned attribute in the reference can affect the score of a model response, even when the extracted information is supported by the judgment. Source-grounding assessment complements comparison with the reference by examining whether the judgment supports the extracted content.
Applying SPIRE to a new domain requires an extraction schema, object alignment rules, and matching criteria appropriate to the task. In this pilot, the source-grounding procedure used heuristic thresholds of 0.72 for long-text similarity and 0.80 for support coverage within a structured object. The extraction evaluation used thresholds of 0.25 for object alignment and 0.90 for Soft Match. The study included neither independent calibration nor a systematic sensitivity analysis of these thresholds. It remains unclear how much the reported scores or the ordering of strategies would change under other settings.
For RQ2 and RQ4, the study specifies procedures for future multi-document experiments. Applying all six strategies to each judgment would allow paired comparisons across documents, while repeating each strategy for each judgment would also allow researchers to estimate variability across runs. Further studies could examine how the results change with different thresholds, alignment rules, or matching methods and assess the protocol with other models and extraction domains.

5. Potential Applications

By design, SPIRE is a domain-independent experimental protocol for prompt engineering research in information extraction. Since it separates the experimental methodology from the underlying information extraction task, it can be applied to a wide range of document collections, application domains, natural languages, information extraction schemas, prompting strategies, and large language models. Adapting SPIRE to a new application requires specification of the extraction schema, construction of the corresponding Ground Truth, and configuration of domain-dependent validation and evaluation procedures.
For now, SPIRE is illustrated in this paper through legal document analysis involving information extraction from a Polish criminal court judgment. Nevertheless, the protocol can also be applied to other legal document types, such as legislation, contracts, administrative decisions, arbitration rulings, and regulatory documents.
Building on this idea, SPIRE is applicable beyond the legal domain to a wide range of document-based information extraction tasks. For instance, in healthcare, it can support the evaluation of prompt engineering techniques for extracting clinical entities, diagnoses, medications, laboratory results, and treatment plans from electronic health records and clinical reports. Similarly, in finance, the protocol can be used to evaluate prompt engineering techniques for extracting structured information from annual reports, financial statements, audit reports, and regulatory filings.
From a broader perspective, beyond domain-specific applications, the protocol can be employed in general natural language processing research involving structured information extraction from unstructured text. Potential application areas include scientific literature mining, business intelligence, customer support systems, public administration, cybersecurity reports, insurance documents, and technical documentation.
The generic structure of the protocol also facilitates the evaluation of emerging prompt engineering techniques. While the illustrative use case focuses on six prompting strategies, the workflow and the corresponding data pipeline can be effectively extended to evaluate additional prompting strategies. More broadly speaking, SPIRE can also be applied to comparative studies involving multiple large language models, model versions, or inference configurations.
Last but not least, the proposed protocol has educational value. It can serve as a practical guideline for teaching experimental methodology in prompt engineering, natural language processing, and information extraction courses. By explicitly separating experimental design, implementation, validation, evaluation, and reporting, the protocol provides students and educators with a structured framework for designing, conducting, and reporting reproducible experiments using large language models.

Author Contributions

Conceptualization, P.W. and H.K.; methodology, P.W. and H.K.; software, P.W.; validation, P.W.; formal analysis, P.W.; investigation, P.W.; resources, P.W.; data curation, P.W.; writing—original draft preparation, P.W.; writing—review and editing, P.W. and H.K.; visualization, P.W.; supervision, P.W.; project administration, P.W.; funding acquisition, H.K. All authors have read and agreed to the published version of the manuscript.

Funding

The research was supported by the project “Cloud Artificial Intelligence Service Engineering (CAISE) platform to create universal and smart services for various application areas”, No. KPOD.05.10-IW.10-0005/24, as part of the European IPCEI-CIS program, financed by NRRP (National Recovery and Resilience Plan) funds.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

All data and source code used in the SPIRE pilot evaluation are publicly available in the Most Wiedzy repository at https://doi.org/10.34808/bn77-0776. The deposited package includes the source judgment, reference annotation, prompt templates, saved model responses, JSON schemas, evaluation scripts, and instructions for reproducing the results.

Acknowledgments

During the preparation of this paper, the authors used ChatGPT v.6.1 and DeepL v.26.9 to assist with language refinement, consistency checking, and formatting. After using these tools, the authors reviewed and edited the manuscript and take full responsibility for its content.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Terras, M. The rise of digitization. In Digitisation Perspectives; Sense Publishers: Rotterdam, The Netherlands, 2011; pp. 3–20. [Google Scholar]
  2. Sarawagi, S. Information extraction. Found. Trends Databases 2008, 1, 261–377. [Google Scholar] [CrossRef] [Scilit]
  3. Hobbs, J.; Riloff, E. Information Extraction. In Handbook of Natural Language Processing; Chapman and Hall/CRC: New York, NY, USA, 2010; Volume 15, p. 16. [Google Scholar]
  4. Baviskar, D.; Ahirrao, S.; Potdar, V.; Kotecha, K. Efficient automated processing of the unstructured documents using artificial intelligence: A systematic literature review and future directions. IEEE Access 2021, 9, 72894–72936. [Google Scholar] [CrossRef] [Scilit]
  5. Jackson, P.; Al-Kofahi, K.; Tyrrell, A.; Vachher, A. Information extraction from case law and retrieval of prior cases. Artif. Intell. 2003, 150, 239–290. [Google Scholar] [CrossRef] [Scilit]
  6. Bommarito, M., II; Katz, D.; Detterman, E. LexNLP: Natural language processing and information extraction for legal and regulatory texts. In Research Handbook On Big Data Law; Edward Elgar Publishing: Cheltenham, UK, 2021; pp. 216–227. [Google Scholar]
  7. Solihin, F.; Budi, I.; Aji, R.; Makarim, E. Advancement of information extraction use in legal documents. Int. Rev. Law Comput. Technol. 2021, 35, 322–351. [Google Scholar] [CrossRef] [Scilit]
  8. Yang, Y.; Wu, Z.; Yang, Y.; Lian, S.; Guo, F.; Wang, Z. A survey of information extraction based on deep learning. Appl. Sci. 2022, 12, 9691. [Google Scholar] [CrossRef] [Scilit]
  9. Landolsi, M.; Hlaoua, L.; Ben Romdhane, L. Information extraction from electronic medical documents: State of the art and future research directions. Knowl. Inf. Syst. 2023, 65, 463–516. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  10. Sheikh, M.; Conlon, S. A rule-based system to extract financial information. J. Comput. Inf. Syst. 2012, 52, 10–19. [Google Scholar]
  11. Premasiri, D.; Ranasinghe, T.; Mitkov, R.; El-Haj, M.; Frommholz, I. Survey on legal information extraction: Current status and open challenges. Knowl. Inf. Syst. 2025, 67, 11287–11358. [Google Scholar] [CrossRef] [Scilit]
  12. Hong, Z.; Ward, L.; Chard, K.; Blaiszik, B.; Foster, I. Challenges and advances in information extraction from scientific literature: A review. JOM 2021, 73, 3383–3400. [Google Scholar] [CrossRef] [Scilit]
  13. Naveed, H.; Khan, A.; Qiu, S.; Saqib, M.; Anwar, S.; Usman, M.; Akhtar, N.; Barnes, N.; Mian, A. A comprehensive overview of large language models. ACM Trans. Intell. Syst. Technol. 2025, 16, 1–72. [Google Scholar] [CrossRef] [Scilit]
  14. Majkutewicz, J.; Szymański, J. Aligning large language models with human preferences using historical text edits. Knowl.-Based Syst. 2025, 322, 113566. [Google Scholar] [CrossRef] [Scilit]
  15. Yu, H.; Guo, Y.; Yang, H.; Zhang, W.; Dong, Y. Can ChatGPT revolutionize language learning? Unveiling the power of AI in multilingual education through user insights and pedagogical impact. Eur. J. Educ. 2025, 60, e12749. [Google Scholar] [CrossRef] [Scilit]
  16. Marvin, G.; Hellen, N.; Jjingo, D.; Nakatumba-Nabende, J. Prompt engineering in large language models. In Proceedings of the International Conference on Data Intelligence and Cognitive Informatics, Tirunelveli, India, 27–28 June 2023; pp. 387–402. [Google Scholar]
  17. Zhou, H.; Hu, C.; Yuan, D.; Yuan, Y.; Wu, D.; Chen, X.; Tabassum, H.; Liu, X. Large language models for wireless networks: An overview from the prompt engineering perspective. In Proceedings of the IEEE Wireless Communications; IEEE: New York, NY, USA, 2025. [Google Scholar]
  18. Knoth, N.; Tolzin, A.; Janson, A.; Leimeister, J. AI literacy and its implications for prompt engineering strategies. Comput. Educ. Artif. Intell. 2024, 6, 100225. [Google Scholar] [CrossRef] [Scilit]
  19. Kwak, A.; Morrison, C.; Bambauer, D.; Surdeanu, M. Classify first, and then extract: Prompt chaining technique for information extraction. In Proceedings of the Natural Legal Language Processing Workshop 2024, Miami, FL, USA, 16 November 2024; pp. 303–317. [Google Scholar]
  20. Commey, D. When “better” prompts hurt: Evaluation-driven iteration for llm applications. arXiv 2026, arXiv:2601.22025v1. [Google Scholar]
  21. Zaghir, J.; Naguib, M.; Bjelogrlic, M.; Névéol, A.; Tannier, X.; Lovis, C. Prompt Engineering Paradigms for Medical Applications: Scoping Review. J. Med. Internet Res. 2024, 26, e60501. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  22. Debnath, T.; Siddiky, M.N.A.; Rahman, M.E.; Das, P.; Guha, A.K.; Rahman, M.R.; Dipu Kabir, H.M. A Comprehensive Survey of Prompt Engineering and Context Engineering Techniques in Large Language Models. Comput. Sci. Rev. 2026, 62, 100979. [Google Scholar] [CrossRef] [Scilit]
  23. Sahoo, P.; Singh, A.K.; Saha, S.; Jain, V.; Mondal, S.; Chadha, A. A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications. arXiv 2024, arXiv:2402.07927. [Google Scholar]
  24. Schulhoff, S.; Ilie, M.; Balepur, N.; Kahadze, K.; Liu, A.; Si, C.; Li, Y.; Gupta, A.; Han, H.; Schulhoff, S.; et al. The Prompt Report: A Systematic Survey of Prompting Techniques. arXiv 2024, arXiv:2406.06608. [Google Scholar]
  25. Vatsal, S.; Dubey, H. A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks. arXiv 2024, arXiv:2407.12994. [Google Scholar]
  26. Li, Y. A Practical Survey on Zero-Shot Prompt Design for In-Context Learning. In Proceedings of the International Conference on Recent Advances In Natural Language Processing (RANLP), Varna, Bulgaria, 4–6 September 2023. [Google Scholar]
  27. Pineau, J.; Vincent-Lamarre, P.; Sinha, K.; Larivière, V.; Beygelzimer, A.; Buc, F.; Fox, E.; Larochelle, H. Improving reproducibility in machine learning research (a report from the neurips 2019 reproducibility program). J. Mach. Learn. Res. 2021, 22, 7459–7478. [Google Scholar]
  28. Goodman, S.; Fanelli, D.; Ioannidis, J. What Does Research Reproducibility Mean? Sci. Transl. Med. 2016, 8, 341s12. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  29. Box, G.E.P.; Hunter, J.S.; Hunter, W.G. Statistics for Experimenters; John Wiley: Hoboken, NJ, USA, 1978. [Google Scholar]
  30. Montgomery, D. Design and Analysis of Experiments; John Wiley & Sons: Hoboken, NJ, USA, 2017. [Google Scholar]
  31. Liang, P.; Bommasani, R.; Lee, T.; Tsipras, D.; Soylu, D.; Yasunaga, M.; Zhang, Y.; Narayanan, D.; Wu, Y.; Kumar, A.; et al. Holistic evaluation of language models. arXiv 2022, arXiv:2211.09110. [Google Scholar]
  32. Bommasani, R.; Hudson, D.; Adeli, E.; Altman, R.; Arora, S.; Arx, S.; Bernstein, M.; Bohg, J.; Bosselut, A.; Brunskill, E.; et al. On the opportunities and risks of foundation models. arXiv 2021, arXiv:2108.07258. [Google Scholar]
  33. Turmo, J.; Ageno, A.; Catala, N. Adaptive information extraction. ACM Comput. Surv. (CSUR) 2006, 38, 4-es. [Google Scholar] [CrossRef] [Scilit]
  34. Chang, Y.; Wang, X.; Wang, J.; Wu, Y.; Yang, L.; Zhu, K.; Chen, H.; Yi, X.; Wang, C.; Wang, Y.; et al. A survey on evaluation of large language models. ACM Trans. Intell. Syst. Technol. 2024, 15, 1–45. [Google Scholar] [CrossRef] [Scilit]
  35. ISO/IEC 25012:2008; International Organization for Standardization ISO/IEC 25012:2008 Software Engineering—Software Product Quality Requirements and Evaluation (SQuaRE)—Data Quality Model. International Organization for Standardization: Geneva, Switzerland, 2008.
  36. Wang, X.; Wei, J.; Schuurmans, D.; Le, Q.; Chi, E.; Narang, S.; Chowdhery, A.; Zhou, D. Self-consistency improves chain of thought reasoning in language models. arXiv 2022, arXiv:2203.11171. [Google Scholar]
  37. Rajpurkar, P.; Zhang, J.; Lopyrev, K.; Liang, P. Squad: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, TX, USA, 1–4 November 2016; pp. 2383–2392. [Google Scholar]
  38. Wang, A.; Singh, A.; Michael, J.; Hill, F.; Levy, O.; Bowman, S. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, Brussels, Belgium, 1 November 2018; pp. 353–355. [Google Scholar]
  39. Dodge, J.; Gururangan, S.; Card, D.; Schwartz, R.; Smith, N. Show your work: Improved reporting of experimental results. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 2185–2194. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.