Validating Library of Congress Subject Headings

Using rule based and LLM systems to validate pre-coordinated LCSH strings

Nov 9 2026

The Library of Congress Subject Heading system is a controlled vocabulary that is almost 130 years old. Despite its age, it is quite flexible in how catalogers are able to use it to describe the content of resources. One key feature of the system is that it is pre-coordinated. This means approved subject terms can be assembled to provide increasing granularity about the contents of the resources. For example:

Art, Renaissance
Art, Renaissance--Italy
Art, Renaissance--Italy--Florence

But how do you know what terms are allowed to be placed in what order? RULES! And that is what makes validating LCSH subjects challenging. There are many types of rules developed over 130 years that are not easy for a computer to understand let alone make a comparison and judgement. For example:

Art, Early Renaissance--Italy--History

Is invalid because it violates a couple rules: “--History” is a fine free-floating under topical headings in rule H 1095, but rule H 1647 sec. 1 bars it under art genre headings qualified by national, ethnic or religious groups (rule H 1250 sec. D.1), and this heading is a period-qualified art form, so it is not an all-inclusive work on the art form.

All these rules are laid out in the Subject Heading Manual (SHM) which a professional cataloger can keep track of and successfully apply the system, especially when working continuously in a specific domain. But these rules require abstract judgement which computers are not good at, judging if a specific word represents a general category of ideas (pattern headings) not contained in a definitive list has not traditionally been possible programmatically.

By combining traditional rule based approaches and making LLM requests for judgment calls it is possible to build a LCSH validator that can apply the SHM the way a person would when constructing a heading. This approach would be considered “Agentic AI” since it is basically a workflow that calls tools and only makes LLM queries when it needs to settle a judgment call. The LLM is never evaluating the overall heading, it is checking specific comparisons which are too large or broad to write a rule (for example is “Art, Early Renaissance” a “period-qualified art form” which it is not, so you need that judgment because you cannot write a list of every period-qualified art form).

The validator is running live at this site: https://thisismattmiller.github.io/lcsh-validator/
It currently uses Claude Haiku 5.5 for the LLM judgment parts of the process.

Open the LCSH Validator in a New Window

The process uses the SHM’s rules to evaluate a submitted heading. For the rules that can be programmatically checked, like if a heading may be subdivided geographically, they have been programmed into the system. For judgment based rules it calls to the LLM with the specific rules to decide the confidence of how valid a heading appears to be.

This flow chart outlines the steps the process goes through to validate a heading using the SHM:

The 1600 pages of the SHM are mostly lists covering special topics about when a heading can be used and when it cannot be used. These rule sheets often reference other rules creating a network of references.

Network graph of the 314 SHM sheets and the citations between them
how the sheets cite each other
Bar chart of the 41 SHM subdivision lists and the subdivisions they share
the subdivision lists
Treemap of the 3,628 rules distilled from the SHM by kind of sheet
the rules distilled from each sheet

In addition to the SHM the tool also references 519 summaries from the SACO editorial meetings (the editorial group for managing LCSH headings). These summaries record thoughts on over 1000 string pre-coordination decisions. If there is a debate about a construction used it is settled in these decision papers. For example:

Computer crimes--Law and legislation

Should not be allowed because the free-floating “--Law and legislation” entries do not name crimes as a category it can be used with. But at the 2014-02-17 meeting it was decided that “--Law and legislation” may be used under headings for crimes and categories of crimes, such as “Murder--Law and legislation” and “Computer crimes--Law and legislation”. The tool then needs to know these decisions and it keeps all of them compiled to be able to pull up references to the decisions made when it is validating a relevant heading.

The system also works on a confidence rating 0-1 meaning that it is possible to get three results from it, valid, invalid and questionable. Questionable results occur when the model is not sure in its judgement call based on the rule reading and what is being tested. This aligns with the idea of cataloger’s judgement, there are some gray areas which the model cannot be 100% sure so there is the ability for it to simply flag it as potentially problematic based on how the rules are being applied to it.

So what would this tool be used for? It is not unfair to say LCSH is a complicated system. There are a lot of moving parts to check to make sure a heading is valid. For a professional cataloger this is second nature to them but simply having a validator to double check it seems like a good fallback. Validation is always part of building a catalog record so why not validate the subject headings? It also seems like a good tool for learning the intricacies of LCSH. There is a cost associated with it, not every check will invoke the LLM but if it does it will cost around $0.002 per heading (fifth of a cent) or around a dollar for 500 headings validated.

Of course the question of how accurate it can be is important. To test for false positives I ran 1000 authorized pre-coordinated headings through the test. These are complex headings that have been published (there are about 200K of them, you can browse them here). These headings should always be valid, since they are authorized in the authority file. To test them I hid their authority records from the tool, so it wouldn’t see they are authorized and therefore correct and then asked it to validate the string. Out of the 1000 authorized headings 5 of them were flagged invalid, of those 4 of them really should be invalid but were authorized anyway (e.g. Vocal music--To 1800 period is not on the music period list or Military supplies--Japan, Military supplies is not coded for geo subdivision but the authorized heading was made anyway). It did mistakenly mark one of these valid strings as invalid: Prostate--Cancer--Pathophysiology. The model treated “Prostate--Cancer” as a heading "of the type [part of the body]--Diseases", and the diseases sheet bars “--Pathophysiology” under that type. It was wrong because that bar applies to the literal subdivision “--Diseases”, not to a specific disease like cancer. So it over fit a rule and marked it as invalid, with this error the tool sits then at 99.8% for this test. Doing the opposite test, running 580 known invalid headings it caught 579 resulting in the same 99.8%. I would not say the tool is perfect, there is always a risk if a tool invokes a LLM for judgment, but there are a lot of guardrails in place to keep the likelihood for false results low. The most likely error would be the tool returning a “Questionable” result, which is more of a soft error than being confidently wrong.

In closing I think this is a “good” example of GenAI usage in cataloging because:

  1. It is not cataloging for the user, it is validating their work. Helping to find mistakes.
  2. It is scoped to a specific task that is very well defined. Not “build me a catalog record claude”
  3. There is no black box, the LLM is not generating random decisions based on its model, it is making judgements with built in guardrails based on supplied cataloging rules.

The source code for the validator can be found in this Github repo.