--- license: cc-by-nc-4.0 language: - en tags: - synthetic - finance - portfolio-management - asset-allocation - risk - knowledge-base - instruction-tuning - rag - adversarial-robustness pretty_name: "Portfolio Management Knowledge Base (FIN-QA-003) — Sample" size_categories: - 1K **Positioning note.** Answers are *templated, structurally-controlled prose* > rendered from a concept ontology — not human-verified factual ground truth. > This corpus is built for **structural / retrieval / reranker / > adversarial-robustness / agent-evaluation** work, not for teaching factual > portfolio knowledge via supervised fine-tuning. See **Limitations**. Each item > is **educational** and **not investment advice**. ## Depth tiers, not a gold/distractor scheme Every question in `multi_depth_answers` has **exactly four answers**, one per audience depth: `beginner`, `intermediate`, `advanced`, `institutional`. All four are legitimate renderings at different sophistication levels; there is intentionally **no single "correct" answer**. The structure supports depth-conditioned generation and depth-ranking tasks. ## Calibration anchors | Metric | Observed (seed 42) | Target | Anchor | |---|---|---|---| | Difficulty mean (1–5) | 3.45 | 3.30–3.75 | Bloom's Taxonomy (portfolio skew) | | Upper-difficulty (4–5) share | 0.50 | 0.45–0.62 | Bloom's upper-level concentration | | Reasoning-required answer share | 0.90 | 0.85–0.95 | FinQA reasoning fraction | | Formula-coverage share | 0.03 | 0.01–0.10 | formula coverage (advanced/institutional only) | | Question-type spread | 5 types, even | exactly 5 even | CFA PM question-type taxonomy | | Persona spread | 5 personas, even | exactly 5 even | retail/advisor/PM/quant/CIO breadth | | Adversarial attack-type spread | 4 types, even | exactly 4 even | OWASP LLM Top-10 | Heavily-weighted **structural integrity floors** (all exact, all pass): exactly 4 distinct depth answers per question; full referential integrity across all FKs; md5-derived id uniqueness; ontology parent-node integrity; per-table column-count contract; complete adversarial behavior coverage; relation self-loops within the disclosed bound. ## Tables (schema highlights) | Table | Rows (sample) | Key columns | |---|---|---| | `finqa003_qa_pairs` | 500 | `qa_id`, `concept_id`, `question_text`, `question_type`, `persona_type`, `difficulty` | | `finqa003_multi_depth_answers` | 2,000 | `answer_id`, `qa_id`, `depth_level`, `answer_text`, `contains_formula_flag`, `requires_reasoning_flag` | | `finqa003_misconceptions` | 50 | `misconception_id`, `concept_id`, `incorrect_statement`, `why_wrong`, `correct_explanation`, `error_type` | | `finqa003_adversarial_queries` | 120 | `adv_id`, `qa_id`, `attack_type`, `adversarial_question`, `expected_behavior` | | `finqa003_conversations` | 80 | `conv_id`, `persona_type`, `turn_sequence` (JSON), `topic_drift_flag`, `resolution_flag` | | `finqa003_concepts` | 100 | `concept_id`, `concept_name`, `category_l1`, `category_l2`, `difficulty_level`, `institutional_relevance_score`, `description_short`, `description_long` | | `finqa003_ontology` | 145 | `node_id`, `node_type`, `name`, `parent_node`, `depth_level` | | `finqa003_relations` | 42 | `relation_id`, `source_node`, `target_node`, `relation_type`, `strength_score` | | `finqa003_formulas` | 6 | `formula_id`, `concept_id`, `formula_latex`, `variable_definitions`, `interpretation` | | `finqa003_examples` | 100 | `example_id`, `concept_id`, `example_type`, `example_description`, `solution_steps` | | `finqa003_use_cases` | 6 | `use_case_id`, `use_case_name`, `description`, `target_buyer` | `relations.source_node` / `target_node` reference **ontology `node_id`** values (md5-derived from `concept_id`). Root ontology nodes (depth 1) have an empty `parent_node`. `conversations.turn_sequence` is JSON-encoded. ## Loading ```python import pandas as pd qa = pd.read_csv("finqa003_qa_pairs.csv") answers = pd.read_csv("finqa003_multi_depth_answers.csv") merged = qa.merge(answers, on="qa_id") print(merged.groupby("qa_id").size().value_counts()) # all == 4 # ontology: preserve empty-string roots (do not coerce to NaN) ontology = pd.read_csv("finqa003_ontology.csv", keep_default_na=False) ``` ```python from datasets import load_dataset qa = load_dataset("xpertsystems/fin-qa-003-sample", "qa_pairs")["train"] answers = load_dataset("xpertsystems/fin-qa-003-sample", "multi_depth_answers")["train"] ``` ## Use cases - **SFT (style/format/depth):** depth-conditioned portfolio-answer generation (retail-plain vs CIO/institutional voice). - **Preference / ranking data:** depth-preference pairs encoding *audience fit* (not factual correctness) for reranker / RLHF-style signals. - **RAG & reranker evaluation:** topic-calibrated `(query, answer-shape)` pairs over a portfolio-management ontology for MRR/NDCG-style metrics. - **Adversarial robustness:** `adversarial_queries` provides prompt-injection, misleading, oversimplification, and hallucination-bait probes appended to legitimate questions, with `expected_behavior` labels (refuse/correct/clarify). ## Limitations (full disclosure) The build process inspected the engine line-by-line. Disclosed observations: 1. **Answers are templated prose, not verified facts.** Answer text is rendered from concept metadata and persona/depth templates; it is plausible and structurally complete but **not** human-verified portfolio truth. Do not use `(question, answer)` pairs as factual SFT ground truth. 2. **No gold/preferred tier.** This is a 4-level depth corpus by design. 3. **Question-type, persona, and adversarial attack-type mixes are deterministic** (round-robin / modulo cycling), so they are exactly uniform by construction. Difficulty is the principal sampled quantity (via a shared `random.Random(seed)`). 4. **One relation self-loop per run (disclosed, deterministic).** The category-cycle relation builder uses `target = items[(i+1) % len(items)]`; when a category contains a single concept this yields a self-loop. The sample contains exactly one such edge. The scorecard verifies self-loops stay within a small disclosed bound rather than requiring zero. 5. **Misconceptions cover only the first `max(50, n_concepts//2)` concepts**, cycled from a 5-pattern pool (50 rows at sample scale). The `incorrect_statement` text applies a literal `.replace("portfolio", concept_name.lower())`, which can read awkwardly when the substring appears mid-word; treat misconception text as templated exemplars. 6. **`formulas` are inherited from base concept templates only** (6 rows at sample scale); expanded concept variants carry the base formula metadata but most concepts have no formula, so `contains_formula_flag` is sparse (≈0.03) and only set at advanced/institutional depth. 7. **IDs are content-derived (md5) for ontology nodes, answers, and formulas**, and sequential for qa/adv/misconception/example. All id sets are verified unique. 8. **Manifest carries no wall-clock timestamp** and no output path, so it is fully reproducible per seed; data files are byte-identical per seed. No benchmark-theater was found: no hardcoded validation values, no `max(actual, target)` floors, no always-true passes, no referential-integrity leaks. Scorecard ranges were calibrated to observed 6-seed behavior; deterministic distributions are scored as exact-target floors and the heavy weight sits on structural integrity. ## Sample vs. full product | Dimension | Sample (this repo) | Full product | |---|---|---| | Questions | 500 | 20,000 | | Concepts | 100 | 1,000 | | Multi-depth answers | 2,000 | 80,000 | | Misconceptions | 50 | ~500 | | Adversarial queries | 120 | 3,000 | | Conversations | 80 | 3,000 | | License | CC-BY-NC-4.0 | Commercial | | Validation | 6/6 seeds Grade A+ (10.0/10) | Full-scale QA suite | ## Determinism Re-running the engine with the same seed produces **byte-identical data files** (verified across all 11 CSVs) and **identical scored metrics**. The wrapper reproduces the engine's exact `main()` orchestration order so the single shared `random.Random(seed)` is consumed identically (verified byte-identical to the native engine). The manifest carries no wall-clock timestamp. ## Citation ```bibtex @misc{xpertsystems_finqa003_2026, title = {Portfolio Management Knowledge Base (FIN-QA-003): A Synthetic, Ontology-Driven Multi-Depth Portfolio-Management Q&A Corpus}, author = {XpertSystems.ai}, year = {2026}, howpublished = {Hugging Face Datasets}, note = {Sample (500 questions) of a 20,000-question commercial product. Difficulty mix calibrated to Bloom's Taxonomy; topic and question-type taxonomy to the CFA Institute portfolio-management curriculum; reasoning-required fraction to FinQA-style financial-reasoning corpora; adversarial attack-type taxonomy to the OWASP LLM Top-10. License CC-BY-NC-4.0.}, url = {https://xpertsystems.ai} } ``` Anchored benchmarks referenced for calibration: Bloom's Taxonomy of educational objectives; CFA Institute candidate body of knowledge (portfolio-management topic and question-type taxonomy); FinQA (Chen et al., financial numerical-reasoning QA); OWASP Top-10 for LLM Applications (adversarial attack taxonomy). ## Disclaimer This dataset is **synthetic** and provided for AI/ML research and engineering. Its content — including allocation, optimization, risk, and performance concepts — is **educational and illustrative only**, is **not investment advice**, is not a recommendation to buy, sell, or allocate to any security or asset class, and is not a substitute for professional financial, legal, or compliance guidance.