DIKWP System Reconstruction: Semantic Compression and Accountability Loop Practices
This article explores the reconstruction of DIKWP (Data, Information, Knowledge, Wisdom, Purpose/Plan) systems, focusing on semantic compression and accountability loops. It covers architecture layering to separate the main system from foundation models, the minimum structure required for a true DIKWP system—including K/W/P conversion acceptance criteria and accountability interfaces—and the interfaces and acceptance standards for core components like the multi-model orchestration layer and semantic compression layer.
1. Unifying Terminology and Scope
DIKWP refers to five levels: Data (D), Information (I), Knowledge (K), Wisdom (W), and Purpose/Plan (P). Raw data is organized into information, information is summarized into knowledge, knowledge forms wisdom under value judgments, and wisdom ultimately falls on executable purposes and plans.
The “DIKWP collapse” mentioned in this article is merely a metaphor describing the process where massive raw data and information are compressed into usable knowledge, wisdom, and plans. There is currently no public industry definition for this, and this article does not use it as a judgment criterion. The term “semantic compression” will be used uniformly below.
This article applies to enterprise systems with accountability interfaces and audit requirements, such as financial risk control, medical assistance, and compliance review scenarios. For one-off demonstrations or low-risk content generation tools, many of the requirements below can be simplified.
2. Architecture Layering: Separating the System from Foundation Models
During reconstruction, the system should be divided into two layers.
The main layer includes the software system, organizational processes, and compliance rules. It determines whether the system can operate long-term. The main layer needs to clarify who is responsible, who approves, who to contact when problems occur, and be able to integrate into the enterprise’s existing business flows and regulatory requirements.
The secondary layer is the foundation model, which refers to various large language models. The secondary layer is only responsible for inference and should exist as a pluggable engine pool. The main layer does not depend on a specific model’s interface format, prompt details, or output habits.
To determine if the layering is reasonable, a switch test can be performed: remove a foundation model from the engine pool. The main layer’s business rules, knowledge base, and audit records should be fully preserved; you only need to reconnect an alternative foundation model and run the regression tests.
3. Minimum Structure of a True DIKWP System
3.1 Three Acceptance Criteria for K/W/P Conversion
K/W/P conversion is the core output of the system. The following three items can be written as test cases. The thresholds provided are examples; teams should calibrate them based on business risk and historical data.
- Intent Consistency (P does not fragment): Prepare 50 multi-step task samples, each containing more than 5 steps of operations. Check whether the output of each step still serves the initial goal. Example threshold: consistency rate no less than 90%; if below the threshold, release is not allowed.
- Rule Validation Pass Rate (W does not drift): Prepare a set of samples containing business restricted areas, such as “must not make specific investment return promises.” Count the proportion of outputs intercepted or correctly rewritten by the rule layer. Example threshold: restricted area violation output is 0, no exceptions allowed.
- Knowledge Transfer Ability (K can generalize): Replace the rules that appeared in training or configuration with new questions in similar scenarios to check whether the system can apply them correctly. Example threshold: the correct rate on new questions is no less than 85% of the correct rate on old questions.
3.2 Accountability Interface
The accountability interface needs to answer the following questions, and each question must have a corresponding recording location in the system.
| Question | Corresponding Role | Example Trace Location |
|---|---|---|
| Who can view raw data | Data Administrator | Access control logs |
| Who can modify business rules | Rule Owner | Rule repository and approval records |
| Who can override system decisions | Business Manager | Override operation logs, requires reason |
| Who signs off on results | Accountable Person | Signature records, linked to trace_id |
| How long to rollback on exception | Ops Lead | Rollback operation records, target time example: within 30 minutes |
3.3 Cross-Foundation-Model Migration
The true assets accumulated by the system are business rules, the knowledge base, and historical audit data, not the foundation model’s parameters. The team should maintain a cross-model regression set containing no less than 200 samples covering core business and their expected results. Every time a foundation model is switched or upgraded, the full regression set must be run. Example pass standard: all critical samples pass, and the overall pass rate is no less than 95% of the pre-switch rate.
4. Interfaces and Acceptance of Core Components
4.1 Multi-Model Orchestration Layer
The orchestration layer is responsible for dispatching tasks to the appropriate foundation model. Routing criteria usually include task type whitelist, single call cost, recent success rate, and latency. The code below illustrates the basic flow of timeout retry, rule validation, degradation switching, and audit recording.
import hashlibimport jsonimport timeimport uuidfrom typing import Any, Dictclass OrchestratorError(Exception):"""Base exception for the orchestration layer"""class EngineNotFoundError(OrchestratorError):"""No foundation model registered for the task type"""class EngineTimeoutError(OrchestratorError):"""Foundation model did not return within the timeout period"""class RuleViolationError(OrchestratorError):"""Output failed validation by the value and rule layer"""class AllEnginesFailedError(OrchestratorError):"""All candidate foundation models failed; requires manual takeover"""def _digest(obj: Any) -> str:raw = json.dumps(obj, ensure_ascii=False, sort_keys=True, default=str).encode("utf-8")return hashlib.sha256(raw).hexdigest()class ModelOrchestrator:def __init__(self, registry, rule_checker, audit_sink,timeout_s: float = 20.0, max_retries: int = 2):self.registry = registry # rank_engines(task_type) returns a list of foundation models sorted by routing strategyself.rules = rule_checker # check(task_type, output), raises RuleViolationError on failureself.audit = audit_sink # write(record: dict)self.timeout_s = timeout_sself.max_retries = max_retriesdef execute_task(self, task_type: str, payload: Dict[str, Any]) -> Dict[str, Any]:trace_id = str(uuid.uuid4())candidates = self.registry.rank_engines(task_type)if not candidates:raise EngineNotFoundError(f"No foundation model registered for task_type={task_type}")start = time.monotonic()attempt = 0for engine in candidates:for _ in range(self.max_retries + 1):attempt += 1try:output = engine.invoke(payload, timeout=self.timeout_s)self.rules.check(task_type, output)latency = int((time.monotonic() - start) * 1000)self._audit(trace_id, task_type, engine.engine_id,payload, output, "ok", None, latency, attempt)return {"trace_id": trace_id, "engine_id": engine.engine_id,"output": output, "latency_ms": latency, "attempts": attempt}except EngineTimeoutError:self._audit(trace_id, task_type, engine.engine_id, payload, None,"timeout", "ENGINE_TIMEOUT", None, attempt)continue # Retry within the same foundation modelexcept RuleViolationError:self._audit(trace_id, task_type, engine.engine_id, payload, None,"rule_violation", "RULE_VIOLATION", None, attempt)break # Rule failure does not retry; switch to the next foundation modelexcept Exception:self._audit(trace_id, task_type, engine.engine_id, payload, None,"engine_error", "ENGINE_ERROR", None, attempt)break # Foundation model exception; switch to the next foundation modelraise AllEnginesFailedError(f"All foundation models failed for trace_id={trace_id}; transfer to manual takeover")def _audit(self, trace_id, task_type, engine_id, payload, output,status, error_code, latency_ms, attempt):self.audit.write({"trace_id": trace_id,"task_type": task_type,"engine_id": engine_id,"input_hash": _digest(payload), # Only record hash to prevent sensitive original text from entering logs"output_hash": _digest(output) if output is not None else None,"status": status,"error_code": error_code,"latency_ms": latency_ms,"attempt": attempt,"ts": time.time(),})
The invocation constraints for the orchestration layer are as follows:
- Input:
task_typeis a registered enum value,payloadis a dictionary, and it does not contain unmasked sensitive fields. - Output: On success, returns
trace_id,engine_id,output,latency_ms, andattempts. - Failure conditions: If it still fails after timeout retries, or fails rule validation, it uniformly enters the manual takeover queue.
- Responsible persons: The platform engineering team is responsible for the orchestration layer, and the rule owner is responsible for the
rule_checker. - Rollback action: Switch the routing strategy back to the previous version’s configuration, or point the engine pool for the corresponding
task_typeto the previous stable foundation model.
4.2 Semantic Compression Layer
The semantic compression layer organizes cross-document, cross-role raw information into structured knowledge nodes. Its goal is to reduce the amount of text downstream needs to process while preserving decisive differences.
Input schema example:
source_id: Unique identifier of the source document or recordsource_type: Document type, enum value such as contract, work order, log, etc.raw_text: Original textowner_role: Responsible role of the text
Output schema example:
node_id: Unique identifier of the knowledge nodeclaim: Compressed conclusion, no more than 200 charactersevidence_spans: List of start and end positions pointing to the original text for verificationconfidence: Confidence level between 0 and 1review_status: Pending review, confirmed, or rejected
Evaluation metrics and threshold examples:
- Compression ratio: The ratio of the total length of node text to the total length of the original text. Example target is between 10% and 30%.
- Key information recall rate: The proportion of key facts annotated by business experts that are covered by the node. Example threshold is no less than 95%.
- Manual correction rate: The proportion of nodes manually modified or rejected. Example threshold is less than 10%. If it exceeds the threshold for two consecutive weeks, suspend automatic warehousing and revert to manual review.
Failure rollback: If the recall rate or correction rate of a batch process does not meet the standard, retain the old version of the node library. The new version is only stored as a draft and will not replace the old one until confirmed by experts.
Human intervention conditions: Nodes with a confidence level lower than 0.6, nodes missing evidence locations, and nodes conflicting with existing nodes must all enter the manual review queue.
4.3 Value and Rule Layer
The rule layer handles business
