# US 2020/0005082 A1 · Byte n-gram embedding model

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0005082 A1
- Document ID: US20200005082A1
- Status: Published application
- Kind: A1
- Application number: 16/237,468
- Filed: 2018-12-31
- Published: 2020-01-02
- Earliest claimed: 2018-06-29
- Assignees: CrowdStrike, Inc.
- Applicants: CrowdStrike, Inc.
- Inventors: Radu Cazan; Daniel Radu; Marian Radu
- Web page: https://patentgrep.com/patent/US20200005082A1

## CPC

- G06F 21/56: Computer malware detection or handling, e.g. anti-virus arrangements
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/22: Matching criteria, e.g. proximity measures
- G06F 21/552: {involving long-term monitoring or reporting}
- G06N 3/0499: Feedforward networks
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Training and use of a byte n-gram embedding model is described herein. A neural network is trained to determine a probability of occurrence associated with a byte n-gram. The neural network includes one or more embedding model layers, at least one of which is configured to output an embedding array of values. The byte n-gram embedding model may be used to generate a hash of received data, to classify the received data with no knowledge of a data structure associated with the received data, to compare the received data to files having a known classification, and/or to generate a signature for the received data.

## Claims

### Claim 1

A method comprising:
extracting a plurality of byte n-grams from a training set of data;
using the plurality of byte n-grams extracted from the training set of data to train a neural network to determine a probability of occurrence of any byte n-gram, wherein the neural network comprises at least one embedding model layer;
receiving data to be processed;
extracting a plurality of byte n-grams from the data to be processed; and
after training the neural network, using the neural network to process the data to be processed based, at least in part, on the plurality of byte n-grams extracted from the data to be processed, wherein processing the data to be processed comprises at least one of:
generating a hash of the data to be processed;
comparing the data to be processed to a file having a known classification;
classifying the data to be processed into one of a plurality of predefined classes; or
generating a signature of the data to be processed.

### Claim 2 (depends on 1)

A method as recited in claim 1, wherein using the plurality of byte n-grams extracted from the training set of data to train the neural network comprises:
extracting features from individual byte n-grams of the plurality of byte n-grams extracted from the training set of data; and
training the neural network based on the extracted features.

### Claim 3 (depends on 2)

A method as recited in claim 2, wherein:
the byte n-grams comprise byte 4-grams; and
the features comprise a plurality of 4-bit nibbles.

### Claim 4 (depends on 1)

A method as recited in claim 1, wherein the data to be processed comprises one or more of:
a complete binary file;
a complete text file;
a portion of a binary file that is currently being downloaded; or
network traffic.

### Claim 5 (depends on 1)

A method as recited in claim 1, wherein the embedding model layer of the neural network is configured to output an array of values.

### Claim 6 (depends on 5)

A method as recited in claim 5, wherein generating a hash of the data to be processed comprises:
analyzing a plurality of arrays of values output by the embedding model layer to determine, for each array position, a maximum value and a minimum value across the plurality of arrays; and
for each array position, determining a first byte n-gram that resulted in the maximum value and determining a second byte n-gram that resulted in the minimum value; and
combining the first byte n-gram and the second byte n-gram for each array position to generate the hash of the data to be processed.

### Claim 7 (depends on 5)

A method as recited in claim 5, wherein the array of values comprises an array of 64 values.

### Claim 8 (depends on 5)

A method as recited in claim 5, wherein classifying the data to be processed into one of the plurality of predefined classes comprises:
calculating one or more summarization statistics over the arrays of values output by the embedding model layer of the neural network for the plurality of byte n-grams extracted from the data to be processed;
comparing the summarization statistics to one or more reference values; and
classifying the data to be processed based on the comparing.

### Claim 9 (depends on 1)

A method as recited in claim 1, wherein comparing the data to be processed to a file having a known classification comprises:
generating the hash of the data to be processed; and
comparing the hash of the data to be processed to a hash of the file having the known classification to determine a similarity score that indicates a degree of similarity between the hash of the data to be processed and the hash of the file having the known classification.

### Claim 10 (depends on 9)

A method as recited in claim 9, wherein comparing the hash of the data to be processed to a hash of the file having the known classification comprises calculating a dot product of embedding arrays associated with byte n-grams in the hash of the data to be processed and embedding arrays associated with byte n-grams in the hash of the file having the known classification.

### Claim 11 (depends on 1)

A method as recited in claim 1, wherein:
extracting the plurality of byte n-grams from the data to be processed comprises using a pseudo-random number generator to identify a subset of byte n-grams in the data to be processed;
generating the hash of the data to be processed; and
using the hash to generate a signature of the data to be processed comprises generating a Yara signature.

### Claim 12

One or more non-transitory computer-readable media storing instructions that, when executed by a processor, cause a computing device to perform operations comprising:
extracting a plurality of byte n-grams from a training set of data;
using the plurality of byte n-grams to train a neural network to determine a probability of occurrence of any byte n-gram, wherein the neural network comprises at least one embedding model layer configured to output an array of values;
after training the neural network, receiving data to be processed; and
using the neural network to process the received data, wherein processing the received data comprises one or more of:
generating a hash of the received data;
generating a hash of a pseudo-random portion of the received data;
classifying the received data; or
generating a signature of the received data.

### Claim 13

A system comprising:
one or more processors;
a memory communicatively coupled to the one or more processors;
a feature extractor stored in the memory and executable by the processor, the feature extractor configured to:
extract a plurality of byte n-grams from data to be processed;
extract one or more features from individual byte n-grams of the plurality of byte n-grams;
a neural network stored in the memory and executable by the processor, the neural network configured to receive the features of a byte n-gram as input, and in response, to output from an embedding model layer of the neural network, an embedding array of values that is calculated based on the features of the byte n-gram.

### Claim 14 (depends on 13)

A system as recited in claim 13, further comprising:
a hash generator stored in the memory and executable by the processor, the hash generator configured to generate a hash of the data to be processed based on the embedding arrays of values output from the embedding model layer of the neural network.

### Claim 15 (depends on 14)

A system as recited in claim 14, wherein the hash generator is configured to:
for each position in an array structure corresponding to the output from the embedding model layer of the neural network, select one or more n-grams from the plurality of n-grams extracted from the data to be processed; and
combine the selected byte n-grams according to a predetermined order to generate the hash of the data to be processed.

### Claim 16 (depends on 15)

A system as recited in claim 15, wherein the hash generator is further configured to:
for each position in the array structure corresponding to the output from the embedding model layer of the neural network:
select a first byte n-gram that resulted in a minimum value in the position in the array; and
select a second byte n-gram that resulted in a maximum value in the position in the array.

### Claim 17 (depends on 13)

A system as recited in claim 13, further comprising a classifier module stored in the memory and executable by the processor to classify the data to be processed, wherein the classifier module is configured to:
calculate one or more summarization statistics over the arrays of values output by the embedding model layer of the neural network for the plurality of byte n-grams extracted from the data to be processed;
compare the summarization statistics to one or more reference values; and
classify the data to be processed based on the comparing.

### Claim 18 (depends on 13)

A system as recited in claim 13, further comprising a classifier module stored in the memory and executable by the processor to compare the data to be processed to a file having a known classification, wherein the classifier module is configured to:
compare the hash of the data to be processed to a hash of the file having the known classification to determine a similarity score that indicates a degree of similarity between the hash of the data to be processed and the hash of the file having the known classification.

### Claim 19 (depends on 18)

A system as recited in claim 18, wherein the classifier module is further configured to calculate a dot product of embedding arrays associated with byte n-grams in the hash of the data to be processed and embedding arrays associated with byte n-grams in the hash of the file having the known classification.

### Claim 20 (depends on 13)

A system as recited in claim 13, further comprising a signature generator module stored in the memory and executable by the processor to generate a Yara signature of the data to be processed.
