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.

    1. import hashlib
    2. import json
    3. import time
    4. import uuid
    5. from typing import Any, Dict
    6. class OrchestratorError(Exception):
    7. """Base exception for the orchestration layer"""
    8. class EngineNotFoundError(OrchestratorError):
    9. """No foundation model registered for the task type"""
    10. class EngineTimeoutError(OrchestratorError):
    11. """Foundation model did not return within the timeout period"""
    12. class RuleViolationError(OrchestratorError):
    13. """Output failed validation by the value and rule layer"""
    14. class AllEnginesFailedError(OrchestratorError):
    15. """All candidate foundation models failed; requires manual takeover"""
    16. def _digest(obj: Any) -> str:
    17. raw = json.dumps(obj, ensure_ascii=False, sort_keys=True, default=str).encode("utf-8")
    18. return hashlib.sha256(raw).hexdigest()
    19. class ModelOrchestrator:
    20. def __init__(self, registry, rule_checker, audit_sink,
    21. timeout_s: float = 20.0, max_retries: int = 2):
    22. self.registry = registry # rank_engines(task_type) returns a list of foundation models sorted by routing strategy
    23. self.rules = rule_checker # check(task_type, output), raises RuleViolationError on failure
    24. self.audit = audit_sink # write(record: dict)
    25. self.timeout_s = timeout_s
    26. self.max_retries = max_retries
    27. def execute_task(self, task_type: str, payload: Dict[str, Any]) -> Dict[str, Any]:
    28. trace_id = str(uuid.uuid4())
    29. candidates = self.registry.rank_engines(task_type)
    30. if not candidates:
    31. raise EngineNotFoundError(f"No foundation model registered for task_type={task_type}")
    32. start = time.monotonic()
    33. attempt = 0
    34. for engine in candidates:
    35. for _ in range(self.max_retries + 1):
    36. attempt += 1
    37. try:
    38. output = engine.invoke(payload, timeout=self.timeout_s)
    39. self.rules.check(task_type, output)
    40. latency = int((time.monotonic() - start) * 1000)
    41. self._audit(trace_id, task_type, engine.engine_id,
    42. payload, output, "ok", None, latency, attempt)
    43. return {"trace_id": trace_id, "engine_id": engine.engine_id,
    44. "output": output, "latency_ms": latency, "attempts": attempt}
    45. except EngineTimeoutError:
    46. self._audit(trace_id, task_type, engine.engine_id, payload, None,
    47. "timeout", "ENGINE_TIMEOUT", None, attempt)
    48. continue # Retry within the same foundation model
    49. except RuleViolationError:
    50. self._audit(trace_id, task_type, engine.engine_id, payload, None,
    51. "rule_violation", "RULE_VIOLATION", None, attempt)
    52. break # Rule failure does not retry; switch to the next foundation model
    53. except Exception:
    54. self._audit(trace_id, task_type, engine.engine_id, payload, None,
    55. "engine_error", "ENGINE_ERROR", None, attempt)
    56. break # Foundation model exception; switch to the next foundation model
    57. raise AllEnginesFailedError(f"All foundation models failed for trace_id={trace_id}; transfer to manual takeover")
    58. def _audit(self, trace_id, task_type, engine_id, payload, output,
    59. status, error_code, latency_ms, attempt):
    60. self.audit.write({
    61. "trace_id": trace_id,
    62. "task_type": task_type,
    63. "engine_id": engine_id,
    64. "input_hash": _digest(payload), # Only record hash to prevent sensitive original text from entering logs
    65. "output_hash": _digest(output) if output is not None else None,
    66. "status": status,
    67. "error_code": error_code,
    68. "latency_ms": latency_ms,
    69. "attempt": attempt,
    70. "ts": time.time(),
    71. })

    The invocation constraints for the orchestration layer are as follows:

    • Input: task_type is a registered enum value, payload is a dictionary, and it does not contain unmasked sensitive fields.
    • Output: On success, returns trace_id, engine_id, output, latency_ms, and attempts.
    • 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_type to 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 record
    • source_type: Document type, enum value such as contract, work order, log, etc.
    • raw_text: Original text
    • owner_role: Responsible role of the text

    Output schema example:

    • node_id: Unique identifier of the knowledge node
    • claim: Compressed conclusion, no more than 200 characters
    • evidence_spans: List of start and end positions pointing to the original text for verification
    • confidence: Confidence level between 0 and 1
    • review_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