Inspiration
Accounting systems are good at recording transactions once the accounting treatment is known. The harder problem is deciding what a transaction actually represents.
A structured transaction may contain a supplier, customer, line items, taxable value, GST, payment information, dates, references, returns, and other metadata, while the correct voucher type is missing. The distinction between a Purchase and Purchase Return, or a Payment and Journal, cannot reliably be determined from a single keyword or field. It requires reasoning across the transaction as a whole.
We built Accountable around this gap.
Our objective was not to create another AI assistant that generates accounting explanations. We wanted to build a transaction intelligence layer that could infer accounting intent, distinguish between closely related voucher categories, and then verify the decision against deterministic accounting constraints.
The core principle became:
Let machine learning interpret the transaction; let accounting rules verify the interpretation.
What it does
Accountable takes structured transaction data and determines the most appropriate accounting voucher category from a broad set of possible classes.
The system considers the complete transaction context rather than relying on isolated keywords. It can reason across fields such as parties, descriptions, amounts, tax information, transaction direction, payment details, dates, and document relationships.
Its pipeline combines:
- Candidate reduction to narrow the relevant voucher categories.
- Neural classification to interpret the transaction semantically.
- Contrastive learning to improve separation between closely related voucher types.
- Hard-negative mining to explicitly train against confusing alternatives.
- Deterministic accounting validation to check the predicted interpretation against domain constraints.
- Reconciliation to verify internal consistency before producing the final decision.
The result is not simply a predicted label. Accountable produces a validated accounting decision with supporting decision context, making the output more suitable for downstream accounting workflows.
How we built it
We designed Accountable as a neuro-symbolic classification and validation pipeline.
Structured Transaction
|
v
Feature / Semantic Representation
|
v
Candidate Voucher Retrieval
|
v
Neural Classification
|
v
Hard-Negative Disambiguation
|
v
Accounting Rule Validation
|
v
Reconciliation
|
v
Validated Accounting Decision
Semantic representation
Instead of treating each spreadsheet column as an isolated signal, we represent the transaction as a unified financial context. This allows the model to use relationships between fields when determining accounting intent.
Candidate reduction
The system first identifies the voucher categories that are genuinely plausible for a transaction. This avoids forcing every transaction to compete equally across unrelated classes and concentrates inference on meaningful alternatives.
Contrastive learning
The difficult cases are usually not completely different voucher types. They are adjacent classes with overlapping characteristics.
We therefore use contrastive learning to encourage the representation of a transaction to be closer to its correct accounting interpretation than to a difficult alternative:
$$ d(f(x), f(y^+)) < d(f(x), f(y^-)) $$
where $y^+$ represents the correct interpretation and $y^-$ represents a hard negative.
Hard-negative mining
We specifically focus training on confusing class boundaries, such as:
- Purchase vs. Purchase Return
- Sales vs. Sales Return
- Payment vs. Journal
- Receipt vs. Sales
- Contra vs. Payment
This makes the model learn the distinctions that actually matter rather than optimizing only for easy classifications.
Deterministic validation
The neural model is not treated as the final authority.
Accountable applies explicit accounting checks after inference, including GST consistency, debit/credit relationships, transaction direction, and reconciliation constraints.
The architecture can therefore be summarized as:
$$ \text{Semantic Inference} + \text{Accounting Constraints} \rightarrow \text{Validated Decision} $$
This separation allows probabilistic models to handle interpretation while deterministic logic handles constraints that should not depend on model confidence.
Challenges we ran into
Fine-grained voucher ambiguity
The hardest cases were not transactions with completely missing information. They were transactions containing enough information to resemble multiple voucher types.
Keyword-based approaches were particularly fragile because the same terms can appear across different accounting workflows.
We addressed this by focusing on semantic representations, candidate reduction, contrastive learning, and hard-negative mining.
Model confidence is not accounting correctness
A classifier can be highly confident and still be wrong.
This is especially problematic in financial workflows, where an incorrect classification can propagate into subsequent accounting operations.
We therefore introduced a deterministic validation layer that can reject or challenge a model prediction when it conflicts with known accounting constraints.
Bridging ML and deterministic systems
The deeper architectural challenge was deciding what should be learned and what should remain explicit.
We kept interpretation in the learned model and accounting invariants in deterministic logic. This prevented the system from forcing domain rules into a probabilistic model while still allowing ML to handle ambiguous transaction semantics.
Building for downstream use
We did not want the system to end at:
Voucher = Purchase
The output needed to be meaningful for an accounting workflow, which required validation, reconciliation, and decision context to be part of the pipeline rather than afterthoughts.
Accomplishments that we're proud of
A genuinely hybrid architecture
The strongest part of Accountable is the boundary between machine learning and deterministic accounting logic.
Instead of asking an LLM or classifier to make an unconstrained financial decision, we designed a system where each component has a defined responsibility.
Fine-grained discrimination
We focused engineering effort on the classes that are actually difficult to separate. Contrastive learning and hard-negative mining make the model explicitly learn difficult voucher boundaries rather than relying on superficial keyword correlations.
Validation beyond classification
Accountable does not equate model confidence with correctness. The prediction has to survive accounting validation and reconciliation before becoming a final decision.
A foundation for auditable automation
The architecture is designed around the requirements of financial workflows: consistency, traceability, deterministic checks, and controlled use of probabilistic inference.
That makes Accountable more than a classification experiment. It is a foundation for building auditable transaction intelligence.
What we learned
The biggest lesson was that accuracy alone is not the right definition of reliability for financial AI.
In ordinary classification, an improvement in aggregate accuracy can be enough to demonstrate progress. In accounting, a small number of systematic errors can have disproportionate downstream consequences.
We learned to focus on the decision boundary and the consequences of an incorrect decision, not just the final class label.
We also learned that machine learning and rules are not competing approaches.
Machine learning is good at answering:
"What does this transaction most likely represent?"
Deterministic logic is better at answering:
"Does that interpretation satisfy the constraints we already know must hold?"
Combining those two capabilities produced a more defensible architecture than relying on either approach independently.
What's next for Accountable
The next stage is moving Accountable from voucher inference toward a broader financial transaction intelligence layer.
Explainable accounting decisions
We want each prediction to expose the strongest signals behind the decision and the validation checks that affected the final outcome, making the system easier for accountants and auditors to inspect.
Human-in-the-loop review
Low-confidence or rule-conflicting transactions can be routed for human verification rather than forcing the system to make an uncertain decision.
This creates a controlled feedback loop where reviewed decisions can improve future model performance.
Continuous learning from accounting corrections
Real accounting workflows generate valuable feedback whenever a classification is corrected. We plan to use these corrections as hard examples for subsequent model training and boundary refinement.
Deeper accounting-system integration
The long-term direction is integration with accounting platforms and enterprise financial workflows so that Accountable can operate as an intelligence layer between transaction sources and accounting systems.
Beyond voucher classification
Voucher inference is the starting point. The same architecture can extend toward transaction anomaly detection, reconciliation assistance, accounting entry validation, compliance checks, and financial workflow automation.
The long-term vision is not to replace accounting systems.
It is to make the intelligence layer between financial data and accounting decisions more accurate, explainable, and controllable.
Built With
- contrastivelearning
- hardnegativemining
- machine-learning
- natural-language-processing
- python
Log in or sign up for Devpost to join the conversation.