Data Scientist, AI Engineer and Architect, and an independent researcher in Bayesian Statistics, Machine Learning and Artificial Intelligence. I build production AI systems end to end, currently in health insurance, from requirements and planning to Knowledge Engineering, model training and deployment. My research asks how people and AI systems turn data, information and expert knowledge into understanding and better decisions, while accounting for uncertainty and the cost of errors.

Areas of Work

  • Epistemology of AI. I created the Data-to-Wisdom Epistemic Architecture for AI, a framework for designing AI systems around how knowledge is justified, communicated and applied (paper). Epistemology studies how knowledge is justified and used, and every AI system depends on both. For many people, the boundaries between Data, Information, Knowledge, Understanding and Wisdom are blurred. The architecture separates them as five functions because each needs different work and different evidence. People and organizations perform these functions too, so the architecture also describes how people work with AI systems and with each other. Some lessons that follow:
    • Data are not knowledge. Data become Information only in context: what was measured, how and for which task. They become Knowledge only through a model or a person’s expertise, which relates it to patterns and expectations. A large dataset is not yet knowledge of anything, and holding it does not mean knowing what it shows.
    • Traditional software starts from knowledge, and Machine Learning works toward it. In traditional software, people write the knowledge down as rules and specifications, and the program applies them. In Machine Learning, the rules are inferred from examples, much like reverse engineering a specification from its outputs.
    • Working toward knowledge is harder because many rules fit the same data. The data alone do not determine the rule. The choice of model encodes assumptions through its inductive bias,1 and those assumptions should come from knowledge of the task and an understanding of the data.
    • A prediction is not yet understanding, and understanding is not yet a decision. Whether a model’s outputs can be relied on, and what to do with them, are separate questions, each with its own evidence.
      • Example: OCR reads “500 mg” on a receipt as “50 mg”. If the reading is taken as fact, the claim is priced and denied for the wrong product, and nothing flags it. If the reading is checked against the medicines catalog, and that product has no 50 mg version, the mismatch goes to a person before any decision.
    • Knowledge of the task is often missing from the system. A model learns from data, and data are not knowledge.
      • Experts hold it tacitly. The knowledge of the task is held by domain experts and is mostly tacit, while engineers rarely know the task as well. Without it, data scientists and engineers have to become partly domain experts themselves, a load that traditional software carries less because it starts from written rules.
      • The cost lands on whoever lacks it. The expert holds it at no cost, and writing it down costs them time with no direct benefit to them, although the organization benefits if it wants to automate the task well. In practice, it rarely happens. Large language models can help experts structure their thoughts and write them down, yet in my experience experts use AI less than data scientists and engineers do. Getting the knowledge out and organizing it therefore falls by default to data scientists and engineers, who are better at structuring knowledge.
      • Experts’ time goes to labels instead of documenting the process. Experts often spend their time marking data as right or wrong, and the model has to infer the rule from many such labels. Documenting the process that leads to each decision, with its steps, rules and reasons, lets the task be automated with the knowledge of those who do it. The written rules become the instructions a large language model receives. Labels are still needed to test the system.
      • Written knowledge makes the system better and easier to automate. Until the knowledge is externalized, as documentation that people and large language models can read, the system cannot use it and performs below what is possible. Once the data come with their metadata and the knowledge of the task is written down, much of the work can be automated with large language models, although checking the outputs still needs independent evidence and people. Spec-Driven Development with Human-in-the-Loop Learning, below, is the methodology I created for that.
    • Building from knowledge pays off again. Expert systems of the 1970s and 1980s were built from knowledge written down by experts, and they stalled because getting that knowledge out was slow and costly. Machine Learning became the default by moving that cost, not removing it: experts label data instead, which needs no articulation but is still human work. The knowledge is split between the labels and the engineers’ choice of a model whose inductive bias fits the task, and neither part is written down. Large language models change this balance: they can read written knowledge and apply it, and they can turn the corrections of experts into rules and tests. The five functions show where to invest, and The Tacit Lesson sets out where scale alone falls short.
  • Bayesian Optimization Through an Epistemic Lens. My most recent paper, Bayesian Optimization Is Rarely Fully Bayesian, maps the loop of Bayesian Optimization onto the Data-to-Wisdom Epistemic Architecture for AI and the Bayesian workflow, and shows which steps the loop leaves out, such as model checking. It shows how prior context can enter the model, generalizes Informative Covariance Functions from a point to sets such as polytopes, and proposes soft deflation for expected improvement that stalls. It also identifies pitfalls of research practice, each with a practice that avoids it, for example:
    • Prior context assumed absent. Bayesian Optimization is meant for costly evaluations, with budgets of tens to a few hundred, so knowledge of where to search has to come from before the search. In many problems, such prior context exists: earlier data, proxy problems, pretrained models, and the understanding of experts. Yet the default prior, with a constant mean and a stationary covariance function, has no place for it. Informative Covariance Functions, from my doctoral research, encode it, so the search can find good solutions with fewer evaluations.
    • One winner across all problems. No optimizer outperforms another averaged over all problems (no free lunch), so a method can be better only where its inductive bias fits. Benchmarks and their scope have to be declared before the comparison, and complementary methods are better combined than reduced to one winner.
    • Methods judged by the final best value or visually. Methods are ranked by the best value after budgets larger than the setting they are meant for, or by visual inspection of curves. Sample efficiency should be measured over the whole run, at the budget of the intended setting, with a Bayesian test whose rubric is fixed before the runs.
    • Regret bounds cited as guarantees of the method run. Standard bounds assume an oracle that knows the covariance function, and the exact global maximizer of the acquisition function at every step. In practice, the hyperparameters are estimated from the evaluations, and the acquisition function, nonconvex and multimodal, is maximized by gradients from several starts with no guarantee of a global maximum, and finding a global maximum is hard in high dimensions. The bounds therefore do not describe the method that is run.
  • Bayesian Optimization and Statistical Modeling. It concerns sequential decisions under uncertainty when each evaluation is costly. I invented Informative Covariance Functions, which encode prior knowledge of where good solutions lie and find them with fewer evaluations (doctoral research, University of Edinburgh).
    • The covariance function is the right place for prior knowledge. In Bayesian epistemology, knowledge belongs in the model, where Bayes’ rule revises it with every evaluation (From Data to Wisdom, Bayesian Optimization Is Rarely Fully Bayesian). The covariance function encodes epistemic uncertainty, so a promising region is encoded as more uncertainty there: higher prior variance and shorter lengthscales, which draw the search and make each evaluation there more informative. If the evaluations disappoint, the posterior revises the region, and the location of the region is fitted to the evaluations. Other methods place that knowledge beside the model or in the acquisition function, the decision rule. There, its influence shrinks on a fixed schedule as evaluations accumulate, at the same rate whether the evaluations confirm it or contradict it, so the evidence never revises it.
  • Spec-Driven Development with Human-in-the-Loop Learning. I created this engineering methodology, which turns the tacit expertise of people into explicit principles, procedures and specifications. Each correction an expert makes becomes reusable guidance and an automated test, so the system improves with use. I apply it at work and in my own knowledge system, run by AI Agents with me as the human in the loop (post).
  • Production AI in Health Insurance. Reimbursement claims processing with large language models, computer vision and AI Agents, with statistical audits and monitoring that measure how reliable the system is.
    • A medication mapper without a large language model. Receipt lines from pharmacy claims are telegraphic and noisy. The mapper parses them back into name, strength, form, container and quantity with grammars compiled into finite automata, matches the remaining name with an edit distance weighted by OCR confusions, and checks each attribute against the national medicines catalog as evidence for or against each candidate. It is deterministic and auditable, and a candidate comparison takes microseconds on a CPU.

Recent Work

All works → Papers, reports, theses and coursework, each with a summary.

Background

Six stages, from a BSc and MSc in Electrical and Computer Engineering to Health Insurance Automation, each with its lesson. Two threads, reasoning under uncertainty and making use of knowledge, join the stages and meet in the Data-to-Wisdom Epistemic Architecture for AI. The architecture leads to the research, Bayesian Optimization Is Rarely Fully Bayesian, and to the engineering, Spec-Driven Development with Human-in-the-Loop Learning.
The two threads meet in the Data-to-Wisdom Epistemic Architecture for AI. Reasoning under uncertainty leads mainly to the research, and making use of knowledge leads to both the research and the engineering. Open the full-size diagram.

Experience

  • Data Scientist, AI, Automation and Innovation team, Future Healthcare, Lisbon. 2024 to present. I design and implement production AI systems for claims processing end to end, with Spec-Driven Development with Human-in-the-Loop Learning.
    • Product: goals defined and refined with the stakeholders, requirements engineering, and the design and implementation of the user interface and user experience (UI and UX).
    • Engineering: system architecture, design and implementation, project management with decision records and delivery plans, full-stack development, deployment, DevOps and MLOps.
    • Data Science and Machine Learning: data curation and analysis, Machine Learning models, retrieval-augmented generation, LLM-as-a-judge pipelines, AI Agents and multi-agent systems, fine-tuning of language and multimodal models, and prompt engineering.
    • Risk Analytics: research and product conception of risk profiles for healthcare providers, insured persons and insurers, built from metrics, indicators, statistical and actuarial models and statistical tests, frequentist and Bayesian, with the uncertainty of each figure carried through to the decisions on audit, negotiation and monitoring.
    • Quality and Audit: statistical methods for auditing reliability and the applications that run them, monitoring and diagnostics, and uncertainty quantification.
    • Knowledge Engineering: elicitation and documentation of the organization’s process knowledge, and documentation as code with AI Agents.
    • Research: invoice quality assessment and the consistency of invoices with prior authorizations.
  • Doctoral Researcher in Machine Learning, School of Informatics, University of Edinburgh. 2019 to 2023. Bayesian Optimization and Likelihood-Free Inference, supervised by Michael U. Gutmann. Tutor of the postgraduate course Probabilistic Modelling and Reasoning in 2020.
  • Research Assistant, Pattern and Image Analysis group, Instituto de Telecomunicações, Lisbon. 2016 to 2017. Deep Learning for ECG-based Biometrics.
  • Quantitative Analyst and Data Scientist, Research and Development, PASS S.A., Lisbon. 2015 to 2016.

Education

  • MSc in Artificial Intelligence, University of Edinburgh, 2018. Distinction, best student of the program (Howe Masters Prize).
  • MSc in Electrical and Computer Engineering, Instituto Superior Técnico, University of Lisbon, 2015. Top 1%.
  1. An inductive bias is the set of assumptions a learning method makes beyond the data. It decides how the method generalizes from the examples it has seen to cases it has not seen. A Gaussian process with a smooth covariance function, for example, assumes that nearby inputs have similar outputs. Without some inductive bias, no method can generalize at all. Tom M. Mitchell, “The Need for Biases in Learning Generalizations”, Rutgers University technical report CBM-TR-117, 1980. ↩