IP Library Granted Patent US 12,346,657
Granted Patent B2
US 12,346,657 · App. 17/883,040 · Granted Jul 1, 2025

Transformer assisted joint entity and relation extraction

Inventors: Xiao Yu (Princeton, NJ); Yanchi Liu (Monmouth Junction, NJ); Haifeng Chen (West Windsor, NJ); Yufei Li (Dallas, TX)
Assignee: NEC Corporation
G06F40/295G06F21/577G06F40/40G06F2221/034
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,346,657
App. No.
17/883,040
Granted
Jul 1, 2025
Kind
B2
Abstract

Systems and methods are provided for adapting a pretrained language model to perform cybersecurity-specific named entity recognition and relation extraction. The method includes introducing a pretrained language model and a corpus of security text to a model adaptor, and generating a fine-tuned language model through unsupervised training utilizing the security text corpus. The method further includes combining a joint extraction model from a head for joint extraction with the fine-tuned language model to form an adapted joint extraction model that can perform entity and relation label prediction. The method further includes applying distant labels to security text in the corpus of security text to produce security text with distant labels, and performing Distant Supervision Training for joint extraction on the adapted joint extraction model using the security text to transform the adapted joint extraction model into a Security Language Model for name-entity recognition (NER) and relation extraction (RE).

Claims (35)

1. A method of adapting a pretrained language model to perform cybersecurity-specific named entity recognition and relation extraction, comprising:

introducing a pretrained language model and a corpus of security text to a model adaptor;

generating a fine-tuned language model through unsupervised training on the pretrained model by the model adapter utilizing the security text corpus;

combining a language model from a head for joint extraction with the fine-tuned language model to form an adapted joint extraction model that can perform entity and relation label prediction by retraining the adapted joint extraction model to predict masked sentences from security text;

generating distant labels by applying noise, including false positives and false negatives, to security text in the corpus of security text aligned with security knowledge bases through similarity to produce security text with distant labels; and

performing Distant Supervision Training for joint extraction on the adapted joint extraction model using the security text with the distant labels to transform the adapted joint extraction model into a Security Language Model for name-entity recognition (NER) and relation extraction (RE) by:

predicting entity labels for determined important tokens in a query word based on position-aware and context-aware representations generated using position attention that encodes query entity information and context information of a query sentence;

calculating confidence scores for the entity labels by determining indicative relation pattern phrases from labeled sentences through relation pattern discovery; and

training the adapted joint extraction model with a training dataset that includes labeled sentences with the entity labels having confidence scores above a quality threshold.

2. The method of claim 1 , wherein the pretrained model is GPT-2.

3. The method of claim 2 , wherein applying labels to security text utilizes a security ontology that provides a schema of structured knowledge, wherein the security ontology includes entity types and relations for cybersecurity and used as labels on the cybersecurity text.

4. The method of claim 3 , wherein there are eight entity types, that include: (1) VULN denoting a vulnerability entity; (2) ACTOR denoting malicious actors that pose threats; (3) THREAT denoting a descriptive entity of threats to a target system; (4) FUNCTION denoting a program function name that appears in security-related reports; (5) FILE denoting a filename; (6) PRODUCT denoting a product name; (7) VERSION denoting a version number of the product; and (8) OBJECT denoting miscellaneous entities.

5. The method of claim 4 , wherein there are seven relation types, that include: (1) VULN_RESULTS_IN_THREAT indicating a potential causal relation between VULN and THREAT entities; (2) VULN_AFFECTS_PRODUCT indicating an effect of a VULN entity on a PRODUCT entity; (3) VULN_HAS_ROOT_CAUSE_IN_FUNCTION indicating a causal relation between VULN and FUNCTION entities; (4) VULN_HAS_ROOT_CAUSE_IN_FILE indicating a causal relation between VULN and FILE entities; (5) ACTOR_EXPLOITS_VULN indicating that an ACTOR entity exploits a VULN entity; (6) THREAT_INVOLVES_OBJECT indicating that a THREAT entity involves one or more OBJECT entities in a course of an instance of cyberattack; and (7) PRODUCT_HAS_VERSION indicating a PRODUCT entity has a specific VERSION.

6. The method of claim 3 , further comprising distant label generation, wherein distant label generation takes in unlabeled security text, and automatically generates the distant labels for entities and relations in accordance with the security ontology and in reference to Knowledge bases.

7. The method of claim 6 , wherein the fine-tuned language model extracts named entities and relations jointly from the corpus of security text.

8. The method of claim 7 , wherein the GPT-2 is a multilayer bidirectional Transformer that converts an input sequence of the cybersecurity text into token-level representations, H 0 ={h t } t=1 T , where h t ∈ d is a d-dimensional vector corresponding to a t-th token in a cybersecurity text sentence.

9. The method of claim 8 , wherein for a given input security text sentence, S={w t } t=1 T , an entity pair (e 1 , e 2 ) in S, a relation label, y, and a relation pattern, m, that explains the relation y of e 1 to e 2 , a corresponding attention guidance score, a m , is calculated according to a pattern mention significance conditional on the relation pattern, m.

10. The method of claim 9 , wherein each transformer layer of the multilayer bidirectional Transformer includes a multi-head self-attention operation.

11. A method of adapting a pretrained language model to perform cybersecurity-specific named entity recognition and relation extraction, comprising:

introducing a pretrained GPT-2 language model and a corpus of security text to a model adaptor, wherein the GPT-2 is a multilayer bidirectional Transformer that converts an input sequence of a cybersecurity text into token-level representations, H 0 ={h t } t=1 T , where h t ∈ d is a d-dimensional vector corresponding to a t-th token in a cybersecurity text sentence;

generating a fine-tuned language model through unsupervised training on the pretrained model by the model adapter utilizing the security text corpus;

combining a language model from a head for joint extraction with the fine-tuned language model to form an adapted joint extraction model that can perform entity and relation label prediction by retraining the adapted joint extraction model to predict masked sentences from security text;

generating distant labels by applying noise, including false positives and false negatives, to security text in the corpus of security text to produce security text with distant labels; and

performing Distant Supervision Training for joint extraction on the adapted joint extraction model using the security text with the distant labels to transform the adapted joint extraction model into a Security Language Model for name-entity recognition (NER) and relation extraction (RE) by:

predicting entity labels for determined important tokens in a query word based on position-aware and context-aware representations generated using position attention that encodes query entity information and context information of a query sentence;

calculating confidence scores for the entity labels by determining indicative relation pattern phrases from labeled sentences through relation pattern discovery; and

training the adapted joint extraction model with a training dataset that includes labeled sentences with the entity labels having confidence scores above a quality threshold.

12. The method of claim 11 , wherein each transformer layer of the multilayer bidirectional Transformer includes a multi-head self-attention operation.

13. The method of claim 12 , wherein applying labels to security text utilizes a security ontology that provides a schema of structured knowledge, wherein the security ontology includes entity types and relations for cybersecurity and used as labels on the cybersecurity text.

14. The method of claim 13 , wherein there are eight entity types, that include: (1) VULN denoting a vulnerability entity; (2) ACTOR denoting malicious actors that pose threats; (3) THREAT denoting a descriptive entity of threats to a target system; (4) FUNCTION denoting a program function name that appears in security-related reports; (5) FILE denoting a filename; (6) PRODUCT denoting a product name; (7) VERSION denoting a version number of the product; and (8) OBJECT denoting miscellaneous entities.

15. The method of claim 14 , wherein there are seven relation types, that include: (1) VULN_RESULTS_IN_THREAT indicating a potential causal relation between VULN and THREAT entities; (2) VULN_AFFECTS_PRODUCT indicating an effect of a VULN entity on a PRODUCT entity; (3) VULN_HAS_ROOT_CAUSE_IN_FUNCTION indicating a causal relation between VULN and FUNCTION entities; (4) VULN_HAS_ROOT_CAUSE_IN_FILE indicating a causal relation between VULN and FILE entities; (5) ACTOR_EXPLOITS_VULN indicating that an ACTOR entity exploits a VULN entity; (6) THREAT_INVOLVES_OBJECT indicating that a THREAT entity involves one or more OBJECT entities in a course of an instance of cyberattack; and (7) PRODUCT_HAS_VERSION indicating a PRODUCT entity has a specific VERSION.

16. The method of claim 15 , wherein for a given input security text sentence, S={w t } t=1 T , an entity pair (e 1 , e 2 ) in S, a relation label, y, and a relation pattern, m, that explains the relation y of e 1 to e 2 , a corresponding attention guidance score, a m , is calculated according to a pattern mention significance conditional on the relation pattern, m.

17. The method of claim 16 , wherein each transformer layer of the multilayer bidirectional Transformer includes a multi-head self-attention operation.

18. The method of claim 17 , wherein for a sequence of labels y={y t } t=1 T , a decoding score, score (Z, y), is calculated as a sum of a transition score from a tag y t to a tag y t+1 , plus an input score z t y t for each token position t.

19. The method of claim 18 , wherein a tag sequence y* is computed using a Viterbi algorithm.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 13, 2025
From: NEC LABORATORIES AMERICA, INC.
To: NEC CORPORATION
Reel/Frame 071095/0825 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 8, 2022
From: YU, XIAO; LIU, YANCHI; CHEN, HAIFENG; LI, YUFEI
To: NEC LABORATORIES AMERICA, INC.
Reel/Frame 060745/0687 →
Continuity (3)
Provisional Application 63299474 · Jan 14, 2022
Provisional Application 63232688 · Aug 13, 2021
Related Publication 20230076127A1 · Mar 9, 2023
References Cited (15)
US 11393141B1 · Hsu · 2022 [cited by examiner]
US 12086546B2 · Meyerzon · 2024 [cited by examiner]
US 20210034701A1 · Fei · 2021 [cited by examiner]
US 20210295822A1 · Tomkins · 2021 [cited by examiner]
US 20220121822A1 · Zhou · 2022 [cited by examiner]
EP 3716111A1 · 2020 [cited by examiner]
WO WO2020243846A1 · 2020 [cited by examiner]
WO WO2021150676A1 · 2021 [cited by examiner]
Zara Nasar, SyedWaqar Jaffry, and Muhammad Kamran Malik. 2021. Named Entity Recognition and Relation Extraction: State-of-the-Art. ACM Comput. Surv. 54, 1, Article 20 (Feb. 2021), 39 pages. https://doi.org/10.1145/34459… [cited by examiner]
Verga, Patrick, “Extracting and Representing Entities, Types, and Relations” (2019). Doctoral Dissertations. 1772. https://scholarworks.umass.edu/dissertations_2/1772 (Year: 2019). [cited by examiner]
Adelani et al., “Distant Supervision and Noisy Label Learning for Low Resource Named Entity Recognition: a Study on Hausa and YorÙb'a”, arXiv:2003.08370v2 [cs.CL], Mar. 31, 2020, pp. 1-9. [cited by applicant]
Song et al., “Learning from Noisy Labels with Deep Neural Networks: A Survey”, arXiv:2007.08199v7 [cs.LG] Mar. 10, 2022, pp. 1-19. [cited by applicant]
Mintz et al., “Distant supervision for relation extraction without labeled data”, Proceedings of the 47th Annual Meeting of the ACL and the 4th IJCNLP of the AFNLP, Aug. 2009, pp. 1003-1011. [cited by applicant]
Lafferty et al., “Conditional Random Fields: Probabilistic Models for Segmenting and Labeling Sequence Data”, Proceedings of the 18th International Conference on Machine Learning 2001 (ICML 2001), Jun. 28, 2001, pp. 282… [cited by applicant]
Zhou et al., “Clinical Temporal Relation Extraction with Probabilistic Soft Logic Regularization and Global Inference”, arXiv:2012.08790v1 [cs.CL], Dec. 16, 2020, pp. 1-10. [cited by applicant]
Cited By (1)
US 12,537,861