4. The computer-implemented method of claim 1 , wherein the plurality of opcode n-grams comprises machine code opcodes and not mnemonic-based instructions.
1. A computer-implemented method for detecting malware, at least a portion of the method being performed by a computing device comprising at least one processor, the method comprising: identifying a plurality of programs represented in machine code; deriving a plurality of opcode n-grams from opcode sequences within the plurality of programs, each opcode n-gram within the plurality of opcode n-grams representing a sequence of opcodes extracted from a program within the plurality of programs; training an autoencoder by using the plurality of opcode n-grams as input; discovering a set of features within the autoencoder after training the autoencoder, each feature within the set of features comprising a linear combination of opcode n-grams from the plurality of opcode n-grams; and classifying a potentially malicious program as malicious by using the set of features discovered within the autoencoder to analyze the potentially malicious program by: initializing a neural network with the set of features discovered within the autoencoder; training the neural network with supervision using a training set labeled to indicate whether each sample within the training set is malicious; and classifying the potentially malicious program using the trained neural network.