Gated sparse encoder neural networks
The gated sparse encoder neural network improves neural network interpretability and controllability by generating sparse representations that penalize only the number of features, addressing the limitations of conventional methods and enhancing task accuracy.
Patent Information
- Application Number
- PCT/US2025/026231
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-24
- Filing Date
- 2025-04-24
- Publication Date
- 2025-12-11
AI Technical Summary
Conventional neural networks operate as 'black boxes' and lack interpretability, leading to misalignment with intended task goals due to biases in sparse autoencoders that penalize both the number and magnitude of features, resulting in less accurate sparse reconstructions.
A system using a gated sparse encoder neural network that processes inputs through a magnitude encoder and a gating encoder to generate sparse representations, penalizing only the number of features, not their magnitudes, thereby improving interpretability and controllability by disentangling feature contributions.
The system achieves more efficient and precise sparse reconstructions with equal accuracy as conventional methods while using half the number of features, enhancing neural network interpretability and controllability, and improving task accuracy by modifying feature contributions.
Smart Images

Figure US2025026231_11122025_PF_FP_ABST
Abstract
Description
[0001]Attorney Docket No.45288-0450WO1 GATED SPARSE ENCODER NEURAL NETWORKS CROSS REFERENCE TO RELATED APPLICATION This application claims priority to U.S. Provisional Application No.63 / 638,369 filed on April 24, 2024. The disclosure of the prior application is considered part of and is incorporated by reference in the disclosure of this application. BACKGROUND This specification relates to processing inputs using machine learning models. As one example, neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input. Some neural networks include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to another layer in the network, e.g., the next hidden layer or the output layer. Each layer of the network generates an output from a received input in accordance with current values of a respective set of weights. SUMMARY This specification describes a system implemented as computer programs on one or more computers that uses a gated sparse encoder neural network to generate sparse representations of inputs to the gated sparse encoder neural network. Particular embodiments of the subject matter described in this specification can be implemented so as to realize one or more of the following advantages. One example application involves neural network interpretation and alignment. Neural networks can perform many useful and complex tasks well, such as image classification, robotic agent control, natural language generation (e.g., computer code generation or editing tasks, text generation or editing tasks), image generation (e.g., image editing tasks, image understanding tasks), and so on. However, even though neural networks can achieve high performance for these tasks, they often operate as “black boxes” that cannot be easily understood. That is, neural networks are often not interpretable in terms of how they are performing tasks relative to their intermediate activations of hidden layers. In order to ensure that neural networks align with intended task goals, it is important that neural networks are more understandable. To this end, motivated by the superposition hypothesis (i.e., in an intermediate representation of dimension ^^, a neural network will encode ^^ ≫ ^^ concepts (or properties or features) as linear directions), sparse autoencoders (SAEs) are used as a technique for unsupervised discovery of interpretable features (or Attorney Docket No.45288-0450WO1 properties) in neural network activations, by finding sparse, linear reconstructions of neural network activations (i.e., reconstructions using a basis of features (directions)). The use of SAEs within target neural networks to process an input and generate a reconstruction of that input improves the performance of the target neural networks for real world machine learning tasks. When a SAE can extract features from inputs and those features are used to generate sparse representations of the inputs or reconstructions of the inputs, the target neural network can reduce its overfitting and improve its generalization. For example, SAEs can be used to first determine features that contribute to particular target neural network outputs and then to secondly enforce use of or avoidance of a subset of those features to improve the target neural network alignment with intended task goals. But, while SAEs are able to find features through sparse reconstructions of neural network activations, these techniques often include biases that limit the ability to discover optimal sparse reconstructions (i.e., the most accurate and sparse reconstructions). For example, the ^^1 loss penalty used in prevailing training methods for SAEs to encourage sparse reconstructions of neural network activations penalizes both the number of features and magnitudes of these features used for reconstructions simultaneously, which can lead to extracting features that are misaligned with the inputs. Only the number of directions should be penalized. Penalizing both the number and magnitude of directions results in sparse but less accurate sparse reconstructions and, therefore, a less accurate set of features. Generally, the described gated sparse (auto)encoding techniques can be used to obtain better feature representations for downstream tasks. For example, the techniques can obtain representations that require half as many firing features to achieve comparable reconstruction fidelity in an autoencoder setting. Thus, the techniques can obtain much more “efficient” sparse representations for use by any type of downstream task. This specification describes a system that can address the aforementioned challenges. That is, this specification describes techniques that include using a gated sparse encoder neural network to generate sparse representations of inputs to the gated sparse encoder neural network. In particular, this specification describes techniques that can be performed by a system implemented as computer programs on one or more computers in one or more locations such that the system can receive a new input, then process the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features. After generating the feature representation, the system can process the new input using a gating encoder neural network to generate a gating representation of the new input that includes a Attorney Docket No.45288-0450WO1 respective gating value for each of the plurality of features. Then, the system can determine, for each of the features, whether the feature is active based on the respective gating value for the feature. Lastly, the system can generate a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active. As a result of processing the new input using both the magnitude encoder neural network and the gating encoder neural network, the system can separately influence which features to use (i.e., influencing the gating representation through the gating encoder neural network) from the magnitude of these features (i.e., influencing feature representation through the magnitude encoder neural network) when determining sparse reconstructions of neural network activations. For example, the system can penalize only the number of features (gating representations) and not magnitudes of features (feature representations) when encouraging sparse reconstructions. So, the described techniques can determine better features through sparse reconstructions than conventional techniques can by penalizing only the number of features and not the magnitude of those features for sparse reconstructions. The described techniques therefore provide a pareto-frontier improvement over conventional techniques in terms of accurate sparse reconstruction of inputs vs sparsity of reconstruction. For example, the described techniques can achieve the same “mean loss recovered” (i.e., a metric for accuracy of sparse reconstruction of inputs) as conventional techniques while using half the number of extracted features that conventional techniques require when processing inputs at many sites of a language model neural network (a transformer-based language model). Having equal accuracy of sparse reconstruction of inputs while using fewer features implies that the features discovered using the described techniques are more efficient and precise at representing inputs than the features discovered using the conventional techniques. Additionally, for this same language model neural network example, the described techniques achieve the best “mean loss recovered” when processing inputs at the same sites of the language model neural network for any given same number of “encoder” neural network parameters used by both the described techniques and conventional techniques. Accordingly, in some implementations, the described techniques provide a system that can improve the interpretability of, controllability of, and task accuracy (or alignment) of neural networks. The described techniques’ system improves interpretability of neural networks by disentangling multiple feature contributions to a neural network output. That is, when the Attorney Docket No.45288-0450WO1 system generates sparse representations of new inputs that each include the respective feature values for the features that have been determined to be active, the system can determine a pattern or association of particular features to particular outputs. For example, the system can perform correlation analysis of feature values to neural network outputs in order to determine relationships. Thus, the system can improve the interpretability of neural networks through pattern recognition of the features of sparse representation processed by the neural network. The system also improves controllability of neural networks by enabling modification of inputs (e.g., intermediate activations) based on sparse representations. That is, the system can be used to interpret a neural network (e.g., to learn an association of feature values of a sparse representation to respective neural network outputs, as described above). Then, subsequent inputs (or intermediate activations) to the neural network can be modified by the system based on the interpretability of the sparse representation to influence the outputs of the neural network through modification of the sparse representations of inputs (or intermediate activations). For example, the system can modify feature values of a sparse representation of an input according to the known relationships to influence neural network outputs (known as “feature steering”) to generate a modified activation for an input. Then, the system can modify subsequent inputs (e.g., intermediate activation) to generate modified inputs (e.g., modified intermediate activations) by replacing components of the subsequent input with components of the modified activation. Consequently, the system can control the output generation of neural networks to contain properties present in the modified activation. Through improved interpretability and controllability, the system of the described techniques can improve task accuracy (or alignment). Which means that the system can improve the neural network’s task accuracy by suppressing or enhancing features present in an input according to the goals of a neural network’s task. For example, for an image classification neural network used for the task of distinguishing images of different types of pets (i.e., dogs, cats, fish, and birds) the neural network may rely on the features of “body size” too heavily and misclassify small dog breeds of dogs as cats. Through “feature steering” (as described above) the system can suppress the use of the “body size” feature in order for the neural network to use other more reliable features, such as “ear shape”, to distinguish dogs from cats. The details of one or more embodiments of the subject matter of this specification are set forth in the accompanying drawings and the description below. Attorney Docket No.45288-0450WO1 According to a first aspect there is provided a method performed by one or more computers. The method includes receiving a new input. Then, processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features. After that, processing the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features. Next, determining, for each of the features, whether the feature is active based on the respective gating value for the feature. Then finally, generating a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active. In some cases, the gating encoder neural network is a single linear neural network layer. In some cases, the magnitude encoder neural network includes a linear neural network layer followed by a non-linear activation function. Further in some cases, the non-linear activation function is a rectified linear unit (ReLU) activation function. In some implementations, determining, for each of the features, whether the feature is active based on the respective gating value for the feature includes determining that the feature is active only when the respective gating value for the feature exceeds a threshold. Further in some implementations, the threshold is zero. In some cases, generating a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active includes generating a masking representation that includes a value of one for each feature that has been determined to be active and a value of zero for each feature that not been determined to be active. Then, element-wise multiplying the masking representation and the feature representation. In some cases, the gating encoder neural network and the magnitude encoder neural network each include a respective linear layer that has a respective weight matrix that has a respective row corresponding to each of the features. Additionally, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the particular row is constrained to be equal to a respective learned transformation applied to a row of the respective weight matrix of the linear layer of the gating encoder neural network that corresponds to a same feature as the particular row. Attorney Docket No.45288-0450WO1 Further in some cases, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, parameters of the respective learned transformation are learned during training of the gating encoder neural network and the magnitude encoder neural network. In some cases, the magnitude encoder neural network and the gating encoder neural network have been jointly trained with a feature decoder neural network on a set of training inputs. Additionally, the feature decoder neural network is configured to receive a representation of a given training input and to process the representation of the given training input to generate a reconstruction of the given training input. Further in some cases, the magnitude encoder neural network, the gating encoder neural network, and the feature decoder neural network have been jointly trained on an objective that, for each training input in the set of training inputs, includes one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network and one or more terms that penalize the gating encoder neural network for designating features as active. Further in some cases, the one or more terms that penalize the gating encoder neural network for designating features as active include an L1 sparsity penalty term on gating values generated by the gating encoder neural network. In some cases, the L1 sparsity penalty term measures an L1 norm of gating values for active features generated by the gating encoder neural network by processing the training input. In some cases, the one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network include a first reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a sparse representation of the training input. In some implementations, the one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network include a second reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a representation of the training input that includes only gating values for active features generated by the gating encoder neural network by processing the training input. Further in some implementations, the decoder neural network is not trained using the second reconstruction loss term. Attorney Docket No.45288-0450WO1 Further in some implementations, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the respective parameters of the learned transformation are not trained using the second reconstruction loss term and the one or more terms that penalize the gating encoder neural network for designating features as active. In some implementations, the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network. Further in some implementations, the target neural network is a language model neural network. In some cases, the network input is part of an input sequence to the language model neural network. Further in some cases, the input sequence is a multi-modal sequence that represents two or more of text, audio, image, or video data. In some implementations, the new input represents audio, image, or video data. In some implementations, the method further includes processing the sparse representation to perform a downstream task on the new input. Further in some implementations, the downstream task is classification of the new input. In some implementations, the downstream task is compression of the new input. In some implementations, when the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network, the new input is an input associated with a particular property. Additionally, the method further includes determining, based on the sparse representation, a modified activation. Then, receiving a subsequent input. Then, processing the subsequent input using the target neural network to generate a subsequent intermediate activation of the hidden layer of the target neural network. Next, modifying the subsequent intermediate activation using the modified activation to generate a modified intermediate activation. Then lastly, processing the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the subsequent input. According to a second aspect there is provided a method performed by one or more computers. The method includes receiving a representation of a new input, where the representation includes a respective value for each of a plurality of features. Then, processing the representation of the new input using a feature decoder neural network to Attorney Docket No.45288-0450WO1 generate a reconstruction of the new input, where the decoder neural network has been trained jointly with the magnitude encoder neural network and the gating encoder neural network according to the methods of the first aspect. In some cases of the second aspect, the representation is a sparse representation that includes zero values for at least a threshold number of the plurality of features. According to a third aspect there is provided a method performed by one or more computers. The method includes receiving a modified activation, where the modified activation has been determined based on a sparse representation obtained according to the methods of the first aspect. Then, receiving an input. Next, processing the input using a neural network to generate an intermediate activation of a hidden layer of the neural network. After that, modifying the intermediate activation using the modified activation to generate a modified intermediate activation. Then lastly, processing the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the input. In some cases of the third aspect, the method further includes determining, based on the sparse representation, the modified activation. In some cases of the third aspect, the new input used for obtaining the sparse representation according to the methods of the first aspect, is an input associated with a particular property. In some implementations of the first, second, or third aspect, the single linear neural network layer and the linear neural network layer share a weight matrix. Additionally, processing the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features includes computing a product between the new input and the shared weight matrix to generate a vector of initial gating values for each of the plurality of features. Then, applying a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features. Additionally, processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features includes applying a learned transformation to the product to generate a vector of initial feature values for each of the plurality of features. Then, applying a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for Attorney Docket No.45288-0450WO1 each of the plurality of features. Then lastly, applying the non-linear activation function to generate a vector of the respective feature values for each of the plurality of features. In some implementations of the first, second, or third aspect, the single linear neural network layer and the linear neural network layer share a weight matrix. Additionally, processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features includes computing a product between the new input and the shared weight matrix to generate a vector of initial feature values for each of the plurality of features. Then, applying a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for each of the plurality of features. Then lastly, applying the non-linear activation function to generate a vector of the respective feature values for each of the plurality of features. Moreover, processing the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features includes applying a learned transformation to the product to generate a vector of initial gating values for each of the plurality of features. Then, applying a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features. According to a fourth aspect, there is provided the methods of the first, second, and third aspects performed by one or more computers and one or more storage devices communicatively coupled to the one or more computers, where the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the respective method. According to a fifth aspect, there is provided the methods of the first, second, and third aspect performed by one or more computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations of the respective method. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG.1 shows a neural network system. FIG.2 is a flow diagram of an example process for generating a sparse representation of a new input. Attorney Docket No.45288-0450WO1 FIG.3 is a flow diagram of an example process for training a gating encoder neural network and a magnitude encoder neural network jointly with a decoder neural network. FIG.4 is an example of the performance of the described techniques. FIG.5 is an example of the performance of the described techniques. FIG.6 is an example of the performance of the described techniques. DETAILED DESCRIPTION FIG.1 shows an example neural network system 100. The system 100 is an example of a system implemented as computer programs on one or more computers in one or more locations, in which the systems, components, and techniques described below can be implemented. The system 100 uses a gated sparse encoder neural network 102 to generate sparse representations 114 of new inputs 104 to the gated sparse encoder neural network 102. Generally, each representation 114 includes a respective feature value for each of a plurality of features. The representations 114 are referred to as “sparse” representations because the feature value for one or more of the features is zero. In some cases, a sparse representation 114 is one that includes zero values for at least a threshold number, e.g., half, of the features. The gated sparse encoder neural network 102 can be configured to process any of a variety of types of new inputs 104 (also referred to as “input observations”). For example, the input observations can be images, i.e., so that the neural network 102 processes the values, e.g. intensity values, of the pixels of the images. As another example, the input observations can be audio data that represent audio signals (waveforms), e.g., audio waveforms, compressed or expanded audio waveforms, or spectrograms. As another example, the input observations can be videos, i.e., so that the neural network 102 processes the intensity values of the pixels of the video frames of the video frames in the video. As another example, the input observations can be other types of sensor data, e.g., point clouds representing Lidar readings, radar readings, and so on. As another example, the input observations can be the outputs of, i.e., intermediate activations of, an intermediate layer of a target neural network. As a particular example, the target neural network can be a language model neural network, e.g., a large language model (an LLM), and the input observation can be an Attorney Docket No.45288-0450WO1 intermediate activation for one of the tokens in an input sequence being processed by the language model neural network in order to generate an output for the input sequence for a particular task. In some cases, the input sequence can be a multi-modal input sequence that includes multiple different modalities of data, e.g., two or more of audio data, text data, image data, or video data. Generally, as used herein, a language model neural network such as an LLM includes a vision language model neural network (VLM), although sometimes references to a VLM are spelt out for clarity. For example, the language model neural network can be an auto-regressive neural network that includes multiple self-attention layer blocks. In this example, the input observation can be the output of one of the layer blocks or an intermediate output of one of the layers within the layer block, e.g., the self-attention layer, the feedforward layer, or the residual connection layer. Further details of examples of language model neural network architectures will be described below. The gated sparse encoder 102 generally includes a magnitude encoder neural network 106 and a gating encoder neural network 108. To process a new input 104 using the gated sparse encoder neural network 102, the system 100 can process the new input 104 using the magnitude encoder neural network 106 to generate a feature representation of the new input 110 that includes a respective feature value for each of a plurality of features. The magnitude encoder neural network 106 can be a neural network that generates a feature representation that represents magnitudes (rather than signs) of the feature values. For example, it can have an output (ReLU) function that leaves positive values unchanged and sets negative values to zero. The system 100 also processes the new input 104 using the gating encoder neural network 108 to generate a gating representation of the new input 112 that includes a respective gating value for each of the plurality of features. As described later the gating values can be used for gating the features. The system 100 determines, for each of the features, whether the feature is active based on the respective gating value for the feature. The system 100 then generates a sparse representation of the new input 114 that includes the respective feature values for the features that have been determined to be active. For example, the sparse representation 114 can include the respective feature values for the features that have been determined to be active and zero values for the features that have not been determined to be active. Attorney Docket No.45288-0450WO1 Generally, the system or another training system trains the gating encoder neural network 108 and the magnitude encoder neural network 106 jointly with a decoder neural network, i.e., as part of a gated sparse auto-encoder. After the encoder neural networks have been trained, representations 114 generated by the trained gated sparse encoder neural network 102 can be used to perform one or more downstream tasks. As one example, the representations 114 can be used for compression, e.g., so that the representations 114 are used to later reconstruct an input observation by the decoder neural network. For example, the system 100 can use the representation as part of the compressed representation directly or further compress the representation using a known compression technique to generate the compressed representation. Some examples of generating the compressed representation are described later. As yet another example, representations 114 generated by the trained encoder neural network 102 can be provided as input to a downstream neural network for performing a downstream task. In general, such a downstream task can be any of the machine learning tasks described later, when the input (input observation) is processed by the gated sparse encoder neural network 102. As one example, the representations 114 generated by the encoder neural network 102 can be used to train a generative neural network that generates new observations (of the same type as the input observations or a different type) conditioned on representations generated using the encoder neural network. As yet another example, the representations 114 can be used as a representation of the observation for a multi-modal task performed by a multi-modal neural network, e.g., a representation of an image or video in visual understanding tasks, e.g., image (or video)-text retrieval tasks, image (or video) classification tasks (processing an image / video to generate a categorical output classifying the image / video or an object or action in the image / video into one of a plurality of categories), image (or video) captioning tasks (processing an image / video to generate text describing the image / video), and visual question answering tasks. The multi-modal neural network can be, e.g., a multi-modal sequence generation neural network, e.g., a multi-modal large language model (LLM), or a visual language model (VLM), or a different type of multi-modal neural network. As another example, the representation 114 can be provided as input to a classifier, e.g., a classification neural network or other type of machine learning model, that is Attorney Docket No.45288-0450WO1 configured to classify the input as belonging to one or more of a set of classes, e.g., object classes. As another example, when the input 104 is an intermediate activation of an intermediate layer of a target neural network, the system 100 can use the sparse feature representation 114 to analyze the performance of the target neural network, e.g., by using a mechanism interpretability technique to interpret the outputs of the target neural network or by performing a different type of analysis. As another example, the system 100 can determine, based on the sparse representation 114, a modified activation. For example, the system can modify the feature values included in the sparse representation (e.g., suppress or enhance feature values) to modify the sparse representation, and then the system can use a decoder neural network to decode the modified sparse representation to generate a modified activation. When receiving a subsequent input, the system 100 can then process the subsequent input using the target neural network to generate a subsequent intermediate activation of the hidden layer of the target neural network; modify the subsequent intermediate activation using the modified activation to generate a modified intermediate activation; and process the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the subsequent input. For example, the new input can be associated with a particular property, and by modifying the subsequent intermediate activation using the modified activation, the system can encourage or discourage (depending on the modified activation) the target neural network from generating outputs that have the particular property. That is, implementations of the system can be used to perform so-called activation steering, either based upon a user input or automatically. FIG.2 is a flow diagram of an example process 200 for generating a sparse representation of a new input. For convenience, the process 200 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural network system, e.g., the neural network system 100 of FIG.1, appropriately programmed in accordance with this specification, can perform the process 200. The system receives a new input (step 202). In particular, the system can receive a new input from a user or another system through any of a variety of means, e.g., through a network connection, e.g., a cloud-based network, the internet, or a local network. For example, the system can be deployed on a user device and the system can receive the new input at the user device, e.g., from a user of the Attorney Docket No.45288-0450WO1 device. As another example, the system can receive a new input from a user using a user device over a network, e.g., by establishing a network connection with the user device. As described above, the new input (also referred to as “input observation”) can be any of a variety of types of inputs. For example, the new input can include natural language text data (e.g., natural language text from webpages, books, that a user typed, and so on), image data (e.g., intensity values of the pixels of the images, e.g., intensity values for greyscale pixels or intensity values for RGB pixels), audio data (e.g., audio waveforms including compressed or expanded audio waveforms, or spectrograms), video data (e.g., intensity values of the pixels of the video frames of the video frames in the video), other types of sensor data (e.g., point clouds representing Lidar readings, radar readings, multispectral readings, and so on), and so on. As a particular example, the new input can be natural language text that represents software source code (i.e., a computer program) that the system receives from a user through a user device such as a laptop. As another particular example, the new input can be a color image (an image that includes intensity values for RGB pixels) that the system receives from a smartphone camera. As another particular example, the new input can be an audio command (i.e. a waveform that includes a user’s utterance) that the system receives from a voice-activated smart assistant device. As another particular example, the new input can be live stream video that the system receives from various peripheral cameras attached to an autonomous vehicle. As another particular example, the new input can be multispectral image that the system receives from satellites. As another example, as described above, the new input can also be an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network. In some cases, the target neural network is a language model neural network and, further in some cases, the network input is part of an input sequence to the language model neural network. For example, the new input can be the intermediate activation of a langue model neural network, e.g., a transformer-based language model. In particular, for this example, the network input can be part of an input sequence to the language model(e.g., a sequence of natural language text representing software code, a sequence of audio spectrogram patches, Attorney Docket No.45288-0450WO1 a sequence of greyscale pixel intensities of an image, or a sequence of RGB pixel intensities for a sequence of video frames of a video, as described above). The new input can be the intermediate activations of various language model sites such as the ‘residual stream post MLP’ site (i.e., the residual stream that results from adding the residual connection to the MLP output), ‘MLP output’ site (the direct output of the MLP block before adding the residual stream), or the ‘attention output pre-linear’ site (i.e., the output of the attention layer before applying the final linear layer). Further in some cases, the input sequence to the language model neural network can be a multi-modal sequence that represents two or more of text, audio, image, or video data. For example, the input sequence can include text instructions and an image encoded as a sequence to tokens. For example, the input sequence can be “Count the number of cars in the parking lot according to this picture. <IMAGE INPUT OF PARKING LOT >” where the sequence of text and image pixels are mapped to tokens belong to a vocabulary in order to create an input sequence of tokens. As another example, the input sequence can include text instructions to identify the time point in a given video of a race that a given competitor (displayed in a given image) announces they are dropping out of the race. For example, the input sequence can be “Print out the timestamp of the video <VIDEO AND AUDIO INPUT OF RACE> that this person <IMAGE INPUT OF PERSON> says ‘I give up’.” where the sequence of text, image pixels, video frame audio data and pixels are mapped to tokens belong to a vocabulary in order to create an input sequence of tokens. In some cases, the new input that is an intermediate activation generated by a hidden layer of a target neural network represents audio, image, or video data. That is, the new input that is an intermediate activation can represent characteristics of the network input that includes audio, image, or video data. For example, for a network input that includes image data, the intermediate activation can represent characteristics of the image such as edges, shapes, or objects. As another example, for a network input that includes audio data, the intermediate activation can represent characteristics of the image such as pitch, tone, or words. As another example, for a network input that includes video data, the intermediate activation can represent characteristics of the image such as color changes, movements, and semantic event categorization. Attorney Docket No.45288-0450WO1 The system processes the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features (step 204). The magnitude encoder neural network can have any of a variety of neural network architectures. That is, the magnitude encoder neural network can have any appropriate architecture in any appropriate configuration that can process a new input to generate a feature representation of the new input that include a respective feature value for each of a plurality of features, including fully connected layers, convolution layers, recurrent layers, attention-based layers, and so on, as is appropriate. As a particular example, in some cases, the magnitude encoder neural network includes a linear neural network layer followed by a non-linear activation function. Further in some cases, the non-linear activation function is a rectified linear unit (ReLU) activation function. Other examples that the non-linear activation function can be include the sigmoid function, and the Tanh function. For example, the magnitude encoder neural network 106 can be represented as the equation ReLU൫^^^^^^^^^൯, where ^^ represents a new input as a column vector, ^^^^^represents a neural network as a weight matrix, the expression represents the output of a single linear neural network layer, and ReLU^⋅^the rectified linear unit non-linear activation function. The system processes the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features (step 206). The gating encoder neural network can have any of a variety of neural network architectures. That is, the gating encoder neural network can have any appropriate architecture in any appropriate configuration that processes a new input to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features, including fully connected layers, convolution layers, recurrent layers, attention-based layers, and so on, as is appropriate. As a particular example, in some cases, the gating encoder neural network is a single linear neural network layer. For example, the gating encoder neural network can be represented as the equation ^^^^௧^^^^^, where ^^ represents a new input as a column vector, ^^^^௧^represents a single linear neural network as a weight matrix, and the expression ^^^^௧^^^^^ represents the output of the single linear layer neural network. Attorney Docket No.45288-0450WO1 In some implementations, the gating encoder neural network and the magnitude encoder neural network share some parameters, so that the output of one or more computations is shared between the processing of the magnitude encoder neural network and the processing of the gating encoder neural network. In some implementations, the gating encoder neural network and the magnitude encoder neural network each include a respective linear layer that has a respective weight matrix that has a respective row corresponding to each of the features. Moreover, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the particular row is constrained to be equal to a respective learned transformation applied to a row of the respective weight matrix of the linear layer of the gating encoder neural network that corresponds to a same feature as the particular row. In other words, for these implementations, the linear layers of the magnitude and gating encoder neural networks share the same projection directions (i.e., the rows of the weight matrices for the magnitude and gating encoders neural networks weights are equal up to a scalar factor). For example, the rows of the weight matrix for the linear layer of the magnitudeencoder neural network can be represented as the equation ^^^^^^^^^:ൌ ^^^^^^^^^^^^^^^^ ⋅^^^^^௧^^^^ , where the indices ^^, ^^ denote row, column indices, forthe single linear layer of the magnitude encoder, ^^^^^is a column vector of parameter values, and the rows of ^^^^^are constrained to be equal to the respective lineartransformation determined by the ^^^^^ parameters, i.e., ^^^^^^^^::ൌ ^^^^^^^^^^^^^^^^ ⋅^^^^^௧^^^:. some cases, the system trains the magnitude encoder neural network and the gating encoder neural network jointly with a feature decoder neural network on a set of training inputs. The feature decoder neural network is a neural network that is configured to receive a representation of a given training input and to process the representation of the given training input to generate a reconstruction of the given training input. Further details of training the system (e.g., training the gating encoder neural network and the magnitude encoder neural network jointly with a decoder neural network) are described below with reference to FIG.3. The system determines, for each of the features, whether the feature is active based on the respective gating value for the feature (step 208). Attorney Docket No.45288-0450WO1 In some cases, the system determines, for each of the features, that the feature is active only when the respective gating value for the feature exceeds a threshold. For example, the system can determine that a feature is active only if the respective gating value for that feature is greater than a threshold such as 0.1, 1, 10, or 100. The system generates a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active (step 210). In some implementations, in order to generate a sparse representation of the new input, the system generates a masking representation that includes a value of one for each feature that it has determined to be active and a value of zero for each feature that has not been determined to be active. After determining the masking representation, the system then performs element-wise multiplication between the masking representation and the feature representation to generate the sparse representation. For example, the system can binarize a vector containing the gating values based on a threshold to generate the masking representation. That is, the system can convert the elements of the vector containing gating values into binary values (e.g., 0, and 1) depending on whether the gating values exceed a threshold value, e.g., a threshold value of zero. As aparticular example, the equation ^^^^^^^௧^^^^^ ^ 0^, where ^^^⋅^ is the indicator function and^^^^௧^^^^^ is the output of a gating encoder neural network that is a single linear layer neural network, represents how the system can generate a masking representation as a result of converting the elements of the vector containing gating values into binary values. Also, continuing with the preceding particular example, the equation ~ ^^^^^^ ≔ ^^^^^^^௧^^^^^^ ^ 0^ ⊙ ^^^^^^^^^^^^^^^^^^^represents an representation, performs element-wise multiplication between the masking representation and the feature ~ representation to generate the sparse representation, where ^^ denotes the new input, ^^^^^^ the sparse representation of the new input, ^^^^^^^^^^^^^^^^^^^ a magnitude encoder neural network that includes a linear neural network layer followed by a non-linear activation function, and ⊙ denotes elementwise multiplication. In some cases, the system applies sparsity to the sparse representation. That is, the system enforces the sparse representation to includes zero values for at least a threshold number of the plurality of features. For example, the system can iteratively set the smallest values of the sparse representation to set to zero until the desired threshold is reached. For example, the system Attorney Docket No.45288-0450WO1 can set the smallest values to zero until a percentage threshold, e.g., 1%, 10%, 99%, is reached or a count threshold, e.g., 1, 10, or 100, is reached. In some implementations, when the gating encoder neural network is a single linear neural network layer and the magnitude encoder neural network includes a linear neural network layer followed by a non-linear activation function, the single linear neural network layer and the linear neural network layer share a weight matrix. To processes the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features, the system computes a product between the new input and the shared weight matrix to generate a vector of initial gating values for each of the plurality of features. The system then applies a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features. Moreover, to process the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features, the system applies a learned transformation to the product to generate a vector of initial feature values for each of the plurality of features. The system then applies a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for each of the plurality of features. The system then applies the non-linear activation function to generate a vector of the respective feature values for each of the plurality of features. The following equation ~ ^^^^^^ ∶ൌ ^^^^^^gate^^^^ ^ ^^gate^ ^ 0^ ⊙ ReLU^^^mag ^ ^^mag^is a processing a ~ new input ^^ to generate a sparse representation ^^^^^^, where: the shared weight matrix ^^gateis shared through the term ^^mag(further defined below); the expression ^^gate^^^^ represents computing a product between the new input ^^ and the shared weight matrix ^^gateto generate a vector ^^gate^^^^ of initial gating values for each of the plurality of features; theexpression ^^^gate^^^^ ^ ^^gate^ represents applying a first bias vector ^^gate to the vector^^gate^^^^ of initial gating values for each of the plurality of features to generate a vector^^^gate^^^^ ^ ^^gate^ of the respective gating values for each of the plurality of features; thedefinition ^^^^^^^^ ∶ൌ ^exp ^^^mag^^^ ⋅ ^^^gate^^^^^^ represents applying a learnedtransformation, for which ^^magare learned parameters of the learned transformation, to the Attorney Docket No.45288-0450WO1 product ^^gate^^^^ to generate a vector ^^^^^of initial feature values for each of the pluralityof features; the expression ^^mag ^ ^^mag represents applying a second bias vector to the ^^magvector of initial feature values for each of the plurality of features to generate a vector^^mag ^ ^^mag of biased feature values for each of the plurality of features; and the expressionReLU^^^mag ^ ^^mag^ represents applying the non-linear activation function ^^^^^^^^^⋅^ togenerate a vector ReLU^^^mag ^ ^^mag^ of the respective feature values for each of theplurality of features. In general weight sharing between the magnitude encoder neural network and the gating encoder neural network, e.g. as described above, can allow the directions of the feature representations (activation projection directions) in these neural networks to correspond whilst allowing their norms to vary, which in turn can preserve the benefits of the described techniques whilst significantly reducing the number of trainable parameters e.g. weights. In some other implementations, when the gating encoder neural network is a single linear neural network layer and the magnitude encoder neural network includes a linear neural network layer followed by a non-linear activation function, the single linear neural network layer and the linear neural network layer share a weight matrix. To processes the new input using a magnitude encoder neural network to generate a feature representation of the new input that includes a respective feature value for each of a plurality of features, the system computes a product between the new input and the shared weight matrix to generate a vector of initial feature values for each of the plurality of features. The system then applies a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for each of the plurality of features. The system then applies the non-linear activation function to generate a vector of the respective feature values for each of the plurality of features. Moreover, to process the new input using a gating encoder neural network to generate a gating representation of the new input that includes a respective gating value for each of the plurality of features, the system applies a learned transformation to the product to generate a vector of initial gating values for each of the plurality of features. The system then applies a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features. The following equation ~ ^^^^^^ ∶ൌ ^ ^ 0^ ⊙ ^is a processing new Attorney Docket No.45288-0450WO1 ~ input ^^ to generate a sparse representation ^^^^^^, where: the shared weight matrix is ^^magis shared through the term ^^^^௧^(further defined below); the expression ^^mag^^^^ represents computing a product between the new input ^^ and the shared weight matrix ^^magto generate a vector ^^mag^^^^ of initial feature values for each of the plurality of features; theexpression ^^mag^^^^ ^ ^^mag represents applying a second bias vector ^^mag to the vector^^mag^^^^ of initial feature values for each of the plurality of features to generate a vector^^mag^^^^ ^ ^^mag of biased feature values for each of the plurality of features; the expressionReLU^^^mag^^^^ ^ ^^mag^ represents applying the non-linear activation function ^^^^^^^^^⋅^ togenerate a vector ReLU^^^mag^^^^ ^ ^^mag^ of the respective feature values for each of theplurality of features; the definition ^^^^^௧^^^ ∶ൌ ^exp ^^^mag^ି^^^ ⋅ ^^^mag^^^^^^ representsapplying a learned transformation, for which ^^magare learned parameters of the learned transformation, to the product ^^mag^^^^ to generate a vector ^^^^௧^of initial gating values foreach of the plurality of features; and the expression ^^^^௧^ ^ ^^gate represents applying a firstbias vector ^^gateto the vector ^^^^௧^of initial gating values for each of the plurality offeatures to generate a vector ^^^^௧^ ^ ^^gate of the respective gating values for each of theplurality of features. In some cases, the system uses the generated sparse representation to perform a downstream task on the new input. For example, the downstream task can be classification of the new input. Examples of classifications of new inputs includes, image object classification, sentiment classification of text, scene classification of video clips, speaker identification of voice audio, and so on. For example, the downstream task can be compression of the new input. That is, the task is to determine a sparse representation for the new input that requires less memory than the new input. Examples of compressions of new inputs include, text compression (e.g., compressing large bodies of texts, such as documents), image compression (e.g., compressing images taken using cameras, medical equipment, satellites, etc.), audio compression (e.g., compressing audio waveforms recordings), and so on. In this case the sparse representation of the new input can be the compressed representation. Decompression of the compressed representation to recover the previously compressed input can be performed using a decoder that is trained concurrently with the gated sparse encoder neural network 102, in the fashion of an autoencoder, e.g. as described below. Attorney Docket No.45288-0450WO1 For some cases in which (i) the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network and (ii) the new input is an input associated with a particular property, the system can further process the sparse representation. In particular, the system can determine, based on the sparse representation, a modified activation. The system can then receive a subsequent input, and then the system can process the subsequent input using the target neural network to generate a subsequent intermediate activation of the hidden layer of the target neural network. Next, the system can modify the subsequent intermediate activation using the modified activation to generate a modified intermediate activation. Then lastly, the system can process the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the subsequent input. As an example of the system modifying the subsequent intermediate activation using the modified activation, the system can substitute certain values of the subsequent intermediate activation using values included the modified activation. In this way, the system can transfer one or more desired properties from the modified activation to the subsequent inputs the system through modification of the intermediate activation. In some implementations, the system can “decode” representations of new inputs. That is, the system can obtain a representation of a new input, where the representation includes a respective value for each of a plurality of features. Then, the system can process the representation of the new input using a feature decoder neural network to generate a reconstruction of the new input, where the decoder neural network has been trained jointly with the magnitude encoder neural network and the gating encoder neural network. For example, when a sparse representation is used for compression of an original input to reduce computational memory requirements to store the original input or to send it over a network, the system can receive the sparse representation and use an appropriate decoder neural network to generate a reconstruction of the new input. Further details of training the gating encoder neural network and the magnitude encoder neural network jointly with a decoder neural network are described below with reference to FIG.3. The feature decoder neural network can have any of a variety of neural network architectures. That is, the decoder neural network can have any appropriate architecture in any appropriate configuration that can process a representation of a new input to generate a Attorney Docket No.45288-0450WO1 reconstruction of the new input, including fully connected layers, convolution layers, recurrent layers, attention-based layers, and so on, as is appropriate. For example, the decoder neural network can include a linear layer that has a respective weight matrix that has a respective column corresponding to each of the features.For example, the equation ^^^^^^^:ൌ ^^dec^^, where ^^ is the representation of a new input as aℝெൈ^ vector, the term ^^dec ∈ ℝ^ൈெ represents a weight matrix of a linear layer for whichM is the number of features and n is the dimension of the input, and ^^^^^^^ represents a reconstruction of the new input. For cases in which (i) the system receives a modified activation determined based on a sparse representation using any of the above-described methods and (ii) the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network, the system can further receive an input and generate an output for the input. In particular, the system can receive an input, process the input using a neural network to generate an intermediate activation of a hidden layer of the neural network, modify the intermediate activation using the modified activation to generate a modified intermediate activation, and process the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the input. Moreover, for some of these cases, the system determines the modified activation based on the sparse representation. For example, as described above, the system can modify the feature values included in the sparse representation (e.g., suppress or enhance feature values) to modify the sparse representation, and then the system can use a decoder neural network to decode the modified sparse representation to generate a modified activation. For example, the described techniques can be used to determine and / or apply an activation steering vector, either automatically or manually. In some cases, the system can use modified activations to generate modified intermediate activation to generate outputs for inputs of the intermediate activation (as described above) in order influence output (or behavior) of the target neural network. When the system modifies the intermediate activation, it can enhance or suppress components of the intermediate activation in order to enhance or suppress certain desired or undesired features. For example, for a target neural network that is a language model that generates natural language text, the system can use the modified activation to generate modified Attorney Docket No.45288-0450WO1 intermediate activations that will suppress features correlated with unapproved topics to then cause the output (e.g., an output sequence of text requested by a user and generated in response to a user prompt) to avoid including information related to the suppressed features. As another example for a target neural network that is a language model, the system can use the modified activation to generate modified intermediate activations that will suppress features correlated with “unsafe code” (e.g., computer language programs the generate memory leaks or generate runtime errors, and so on) to then cause the output (e.g., an output sequence of text representing a computer program requested by a user in response to a user prompt) to not exhibit these properties. For example, a user prompting the target neural network to “generate a computer program to manage energy production of the power plant in response to energy demand” can result in an output that does not include “unsafe code” when the system suppresses the feature of “unsafe code”. This can be done automatically. As another example, for a target neural network that generates images, the system can use the modified activation to generate modified intermediate activations that will enhance features correlated with a specific feature, e.g., a “ocean theme”, to then cause the output (e.g., an output sequence of pixels that make up an image generated in response to a user prompt) to exhibit these properties. For example, a user prompting the target neural network to “generate an image of a bear” can result in an output image that includes in the bear on the beach due to the system enhancement of the “ocean theme” feature. This may be done manually, e.g. based on an input from a user, or based on an input from another machine learning system. Furthermore, for certain cases in which the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network, the input is associated with a particular property. That is, the system modifies intermediate activations (e.g., as described above) using an input associated with a particular property, represented as a feature of the respective sparse representation, to yield intermediate activations that influence the target neural network’s outputs to exhibit this same particular property. In most cases, prior to using the gating encoder neural network and the magnitude encoder neural network to generate sparse representations and using the sparse representations to perform downstream tasks on new inputs, the system or another training system trains these encoders on a training dataset. Attorney Docket No.45288-0450WO1 FIG.3 is a flow diagram of an example process 300 for training a gating encoder neural network and a magnitude encoder neural network jointly with a decoder neural network. For convenience, the process 300 will be described as being performed by a system of one or more computers located in one or more locations. For example, a neural network system, e.g., the neural network system 100 of FIG.1, appropriately programmed in accordance with this specification, can perform the process 300. The system or another training system trains the gating encoder neural network and the magnitude encoder neural network jointly with a decoder neural network by repeatedly updating the trainable parameters of these neural networks using a training dataset. The system can train these neural networks on a training dataset that includes a plurality of training inputs. That is, the system can repeatedly perform the following described example process using training inputs to train the neural networks from scratch, i.e., train from randomly initialized parameters of the neural network, or to fine-tune, i.e., further update previously determined parameters of the neural network. In some cases, when the system uses learned transformations to constrain the rows of the respective weight matrix of the linear layer of the magnitude encoder neural network to be equal to respective learned transformations applied to the row of the respective weight matrix of the linear layer of the gating encoder neural network the parameters, the system learns the transformation during training of the gating encoder neural network and the magnitude encoder neural network. That is, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the system learns the parameters of the respective learned transformation during training of the gating encoder neural network and the magnitude encoder neural network. The system obtains a training dataset that includes training inputs (step 302), which the system obtains from a user or another system. The training inputs included in the training dataset are of the same type and format as the “new inputs” that the system can receive and process. Therefore, the training inputs can be “input observations” that include text data, image data, audio data, video data, or intermediate activations generated by a hidden layer of a target neural network, and so on. There are many suitable datasets available; merely as an example dataset that includes interleaved text and images is the WebLI dataset, Web Language Image, Chen et al. arXiv:2305.18565v1 (which has various versions of differing sizes). The system, for each training input, processes the respective training input and generates a representation of the training input (step 304). Attorney Docket No.45288-0450WO1 That is, the system can process the training input to generate a representation of the training input using any one of the above-described techniques that uses the magnitude encoder neural network and gating encoder neural network. It follows that the system, for each training input, generates a respective feature value for each of a plurality of features using the magnitude encoder neural network and generates a gating representation of the training input using the gating encoder neural network. The system then determines, for each training input and for each of the features, whether the feature is active based on the respective gating value for the features. Then lastly, the system generates a sparse representation of the training input, for each training input, that includes the respective feature values for the features that have been determined to be active. The system, for each training input, processes the representation of the training input and generates a reconstruction of the training input (step 306). In particular, to generate the reconstruction of the training input, the system processes the representation of the training input using the decoder neural network (i.e., the feature decoder neural network), e.g., a feature decoder neural network as described above to generate a reconstruction of the given training input. The system evaluates an objective using all training inputs and respective reconstructions of the training inputs (step 308). In some cases the objective, for each training input in the set of training inputs, includes one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network and one or more terms that penalize the gating encoder neural network for designating features as active. In particular, for some cases, the one or more terms that penalize the gating encoder neural network for designating features as active include an L1 sparsity penalty term on gating values generated by the gating encoder neural network. Furthermore, for some of these cases, the L1 sparsity penalty term measures an L1 norm of gating values for active features generated by the gating encoder neural network by processing the training input. For example, the equation ^^‖^^gate^^^^‖^represents a ^^ scaled L1 sparsity penalty term on gating values generated by the gating encoder neural network (i.e., a term that penalizes the gating encoder neural network for designating features as active), where ^^ denotes the vectorized training input and ^^gate^^^^ denotes the vectorized gating values generated by the gating encoder neural network. Attorney Docket No.45288-0450WO1 The one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network can include a first reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a sparse representation of the training input. As one example, the objective can include, for each training input in the set of training inputs, a loss represented as the equation ~ ‖^^ െ ^^ ^^^^^^^^^‖ଶଶ ^ ^^‖ReLU^^^gate^^^^^‖^, with terms expressed in – and where the term ^^ denotes the training input; the term ^^^^^^ denotes the representation of the training input generated by the gating encoder neural network and magnitude encoder neural network; the term ^^^^௧^^^^^ denotes the gating representation of the training input that includes a gating value for each of the plurality of features; the function ReLU^⋅^ is the ^ ~ rectified linear unit activation function; the term ^^^^^^^^^^ denotes the reconstruction of theraining input generated by the feature decoder neural network; the term ‖^^ െ ^^ ~t ^^^^^^^^^‖ଶଶ ^ denotes the squared distance between the input ^^ and the reconstruction ^^ , i.e., a term that measures a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network; and the term ‖ReLU^^^^^௧^^^^^^‖^denotes the L1 sparsity penalty term on gating values generated by the gating encoder neural network, i.e., a term that penalizes the gating encoder neural network for designating features as active. In some cases, the one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network can include a second reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a representation of the training input that includes only gating values for active features generated by the gating encoder neural network by processing the training input. In some cases the decoder neural network is not trained using the second reconstruction loss term. As one example, the second reconstruction loss term can be represented as the equation െ^^ ^ଶ, where all notation of the unless stated otherwise, and Attorney Docket No.45288-0450WO1 where ^ the function ^^^^^௭^^^⋅^ denotes the reconstruction of the training input using the decoder neural network with “frozen” parameter (i.e., parameters that do not participate in backpropagation when the system computes gradients using the term); and, consequently,^ ^^^^^௭^^^^^^^^^^^^^^^^௧^^^^^^^ is the representation of the training input that includes only gating values for active features generated by the gating encoder neural network by processing the training input and the decoder neural network is not trained using this second reconstruction loss term because this term’s “frozen” parameters of the decoder do not participate in backpropagation. As an example objective that includes (i) a term that measures a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network, (ii) the L1 sparsity penalty term on gating values generated by the gating encoder neural network, and (iii) a second reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a representation of the training input that includes only gating values for active features generated by the gating encoder neural network by processing the training input, the objective can be ‖^^ െ ^^ ~ ^^^^^^^^^‖ଶ^ ଶ^ ^^‖ReLU^^^gate^^^^^‖^ ^ ‖^^ െ ^^ ^^^௭^^^^^^^^^^^^^^^^௧^^^^^^^‖ଶଶerms in the equation are defined above, and ‖^^ െ ^^ ~, where t ^^^^^^^^^‖ଶଶ is an example of (i),^^‖ReLU^^^gate^^^^^‖^ an example of (ii), and ‖^^ െ ^^ ^^^^௭^^^^^^^^^^^^^^^^௧^^^^^^^‖ଶଶ an example of (iii). Further for some of these cases, when the system learns the parameters of the respective learned transformation during training of the gating encoder neural network and the magnitude encoder neural network, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the respective parameters of the learned transformation are not trained using the second reconstruction loss term and the one or more terms that penalize the gating encoder neural network for designating features as active, such as an L1 sparsity penalty term as described above. For example, considering an objective that includes the example L1 sparsity penalty term and second reconstruction loss term above, e.g., െ^^ ~ ^^^^^^^^ଶ ^ ^ െ ^^ ^ଶ Attorney Docket No.45288-0450WO1 only the first term ‖^^ െ ^^ ~, ^^^^^^^^^‖ଶଶ will contribute to updating the parameters of the learned transformation because it is the only term that includes those parameters. The system updates trainable parameters to optimize the objective (step 310). The system can update the trainable parameters of the neural networks to optimize the objective in any variety of ways, e.g., gradient based method, evolutionary algorithm- based method, Bayesian optimization, etc. For example, the system can optimize the objective using any of a variety of gradient descent techniques (e.g., batch gradient descent, stochastic gradient descent, or mini-batch gradient descent) that include the use of a backpropagation technique to estimate the gradient of the loss with respect to trainable parameters of the neural networks and to update the learnable parameters accordingly. Generally, the system repeats the above steps until one or more criteria are satisfied (e.g., the system performs a pre-determined number of iterations, the updates to the trainable parameters no longer exceed a pre-determined magnitude of change, a metric regarding a validation dataset exceeds a pre-determined value, and so on). FIG.4 is an example 400 of the performance of the described techniques. In particular, example 400 is a plot that shows that the described techniques (labeled as “Gated”) improve the pareto frontier of “Loss Recovered” vs “L0” when the described techniques process inputs that are the MLP neuron activations of the GELU-1L neural network performing a natural language task relative to a conventional technique, i.e., a sparse autoencoders (SAE) processing the inputs, (labeled as “Baseline (1.5x width)”). The “Loss Recovered” axis refers to a measure of the average cross-entropy loss of the GELU-1L language model on an evaluation dataset, when the reconstructions of the inputs are spliced into it. Let CE(ϕ) denote the average loss of the language model when thefunction ^^:ℝ^ → ℝ^ is spliced at a site (i.e., the MLP neuron activations site of GELU-1L)during the forward pass, then the “loss recovered” is defined as CE^^ ^ ^ ^1 െ ^^ ∘ ^^ െ CE IdCE^ζ^ െ CE^Id^where ^ ^^^ ∘ ^^ ^ is the reconstruction of the input from a sparse representation, ^ ζ: ^^ ↦ 0 ^the zero-ablation function and ^Id: ^^ ↦ ^^^ the identity function. According to thisdefinition, a technique that always outputs the zero vector as the reconstruction of the input would get a loss recovered of 0%, whereas a technique that reconstructs its inputs perfectly would get a loss recovered of 100%. The L0 denotes the average number of active features Attorney Docket No.45288-0450WO1 in a sparse representation of a given input, i.e., ^^^^∼^^‖^^^^^^‖^where ^^^^∼^^denotes an expectation over inputs drawn from the dataset ^^. Example 400 shows that the described techniques always performs better than the conventional techniques (even though the conventional techniques are set to learn 50% more features (i.e., the encoder neural network of the conventional technique has 50% more projection directions than does the gated sparse encoder neural network of the describedtechniques) to account for the 1.5 ൈ more compute train time the describe techniquesrequire compared to the conventional technique. So, the described techniques can achieve better reconstruction accuracy (i.e., “loss recovered”) with lower “L0 sparsity” and using fewer features than conventional techniques can. FIG.5 is an example 500 of the performance of the described techniques. In particular, example 500 is a plot that shows the described techniques can address “shrinkage” while conventional techniques do not. The defined concepts (i.e., “L0” of the x- axis, application of the described techniques to process inputs from a particular site of the GLEU-1L language model, etc.) and labels (i.e., “Baseline” and “Gated”) of example 400 apply to this example 500 as well. The ”Baseline” conventional techniques train (a SAE) using a L1 sparsity penalty which causes feature activations to be systematically underestimated, a phenomenon called “shrinkage” which shrinks the sparse reconstructions produced by a decoder. The extent to which a SAE trained using conventional techniques is affected by shrinkage can be measured as the average norm of its reconstructions of inputs. Concretely, the metric for shrinkage is the “relative reconstruction bias ^^” defined as, ^ ^^:ൌ arg ^^^^^^^^^^∼^^^‖^^ᇱSAE^^^^ / ^^ െ ^^‖ଶଶ^, ^ where ^^SAE^^^^ is the and ^^−1is the optimum multiplicative factor by which an SAE’s reconstructions should be rescaled in order to minimize the L2 reconstruction loss; ^^ = 1 for an unbiased SAE and ^^ < 1 when there’s shrinkage. Example 500 shows that conventional techniques suffer from more shrinkage as sparsity increases (i.e., L0 is lower) over a range, while the described techniques (“Gated”) effectively do not suffer from shrinkage over the same range. FIG.6 is an example 600 of the performance of the described techniques. Attorney Docket No.45288-0450WO1 In particular, example 600 is a plot that shows that all components of the described techniques contribute to the performance of the described techniques. In particular, example 600 shows an ablation study of the described techniques using pareto frontiers of “Loss Recovered” for the MLP neuron activations of the GELU-1L neural network that can perform a natural language task vs “L0” for various techniques. The defined concepts (i.e., “Loss Recovered” y-axis, “L0” x-axis, application of the described techniques to inputs from a particular site of the GLEU-1L language model, etc.) and labels (i.e., “Baseline” and “Gated”) of example 400 apply to this example 600 as well. Example 600 shows that using all concepts of the described techniques (i.e., “Gated”) performs best with a pareto frontier that lies the most to the top left of the plot. Simultaneously, the pareto frontier of the conventional technique (a technique that uses a spare autoencoder without the described techniques above) performs worst, and the pareto frontiers using a subset of the described techniques (i.e., “Ablation: unfreeze decoder”, “Ablation: no r_mag”, “Ablation: untie encoder layers”) achieve performance between the best and the worst pareto frontiers. In particular, the pareto frontier that corresponds to “Ablation: unfreeze decoder” corresponds to using a second reconstruction loss that measures a quality of a reconstruction of the training input generated by the feature decoder neural network term to train the decoder neural network instead of “freezing” the decoder neural network parameters. The plot of example 600 shows that there is a reduction in performance. The pareto frontier that corresponds to “Ablation: no r_mag” corresponds to not using the above-described technique of learning a transformation to apply to a row of the respective weight matrix of the linear layer of the magnitude encoder neural network using a row of the respective weight matrix of the linear layer of the gating encoder neural network. That is, the weight matrices of the linear layer of the gating and magnitude encoder can at most differ by an elementwise shift. As a result, the pareto frontier for this ablation has a slight drop in performance, suggesting that learning a transformation between the weight matrix of the gating encode and magnitude encoder contributes to the improved performance of the “Gated” pareto frontier. The pareto frontier that corresponds to “Ablation: untie encoder layers” corresponds to not using the above-described technique of sharing weight matrices between the gating encoder and magnitude encoder and, instead, instead the gating encoder and magnitude encoder have their own independent weight matrices each. There is a slight performance Attorney Docket No.45288-0450WO1 deterioration of this technique’s pareto fronter, and this technique required 50% increase in parameter count and inference-time compute relative to the “Baseline”. In conclusion, example 600 shows that components of the described techniques contribute to the advantages and performance of the described techniques. As described above, in some cases, the input observations (i.e., new inputs) of the neural network system can be the outputs of, i.e., intermediate activations of, an intermediate layer of a target neural network, and the target neural network can be a language model neural network. The language model neural network (hereinafter referred to as neural network) can be configured through training to perform any kind of machine learning task, i.e., can be configured to receive any kind of input sequence and to generate any kind of score, classification, or regression output based on the input sequence. In some situations, the neural network can be referred to as an auto-regressive neural network when the neural network auto-regressively generates an output sequence of tokens. More specifically, the auto-regressively generated output is created by generating each particular token in the output sequence conditioned on a current input sequence that includes any tokens that precede the particular token in the output sequence, i.e., the tokens that have already been generated for any previous positions in the output sequence that precede the particular position of the particular token. For example, the neural network can be an auto-regressive Transformer-based neural network that includes (i) a plurality of attention blocks that each apply a self-attention operation and (ii) an output subnetwork that processes an output of the last attention block to generate the score distribution. In this example, the neural network can have any of a variety of Transformer-based neural network architectures. Examples of such architectures include those described in J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. d. L. Casas, L. A. Hendricks, J. Welbl, A. Clark, et al. Training compute-optimal large language models, arXiv preprint arXiv:2203.15556, 2022; J.W. Rae, S. Borgeaud, T. Cai, K. Millican, J. Hoffmann, H. F. Song, J. Aslanides, S. Henderson, R. Ring, S. Young, E. Rutherford, T. Hennigan, J. Menick, A. Cassirer, R. Powell, G. van den Driessche, L. A. Hendricks, M. Rauh, P. Huang, A. Glaese, J. Welbl, S. Dathathri, S. Huang, J. Uesato, J. Mellor, I. Higgins, A. Creswell, N. McAleese, A.Wu, E. Elsen, S. M. Jayakumar, E. Buchatskaya, D. Budden, E. Sutherland, K. Simonyan, M. Paganini, L. Sifre, L. Martens, X. L. Li, A. Kuncoro, A. Nematzadeh, E. Gribovskaya, D. Donato, A. Lazaridou, A. Mensch, J. Attorney Docket No.45288-0450WO1 Lespiau, M. Tsimpoukelli, N. Grigorev, D. Fritz, T. Sottiaux, M. Pajarskas, T. Pohlen, Z. Gong, D. Toyama, C. de Masson d’Autume, Y. Li, T. Terzi, V. Mikulik, I. Babuschkin, A. Clark, D. de Las Casas, A. Guy, C. Jones, J. Bradbury, M. Johnson, B. A. Hechtman, L. Weidinger, I. Gabriel, W. S. Isaac, E. Lockhart, S. Osindero, L. Rimell, C. Dyer, O. Vinyals, K. Ayoub, J. Stanway, L. Bennett, D. Hassabis, K. Kavukcuoglu, and G. Irving. Scaling language models: Methods, analysis & insights from training gopher. CoRR, abs / 2112.11446, 2021; Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683, 2019; Daniel Adiwardana, Minh-Thang Luong, David R. So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, and Quoc V. Le. Towards a human-like open-domain chatbot. CoRR, abs / 2001.09977, 2020; and Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. Generally, to apply the self-attention operation, each attention block uses one or more attention heads. Each attention head generates a set of queries, a set of keys, and a set of values, and then applies any of a variety of variants of query-key-value (QKV) attention, e.g., a dot product attention function or a scaled dot product attention function, using the queries, keys, and values to generate an output. Each query, key, value can be a vector that includes one or more vector elements. When there are multiple attention heads, the attention block then combines the outputs of the multiple attention heads, e.g., by concatenating the outputs and, optionally, processing the concatenated outputs through a linear layer. Some examples of machine learning tasks that a neural network when implemented using one of the architectures described above or other known architectures can be configured to perform follow. In implementations the neural network may be configured as, or include, a generative (large) language model or a multi-modal model, e.g., a visual and language model, as described above to perform these example machine learning tasks. For example, the above described target neural network can perform these tasks. As another example, these tasks may be performed as downstream tasks by processing a new input (input observation) as described above to generate the above described sparse representation that is then used for performing the task (and thus references, below, to an input can be to an “input observation”). Attorney Docket No.45288-0450WO1 In some cases, the neural network is a neural network that is configured to perform an image processing task, i.e., receive an input image and to process the input image to generate a network output for the input image. For example, the task may be image classification and the output generated by the neural network for a given image may be scores for each of a set of object categories, with each score representing an estimated likelihood that the image contains an image of an object belonging to the category. As another example, the task can be image embedding generation and the output generated by the neural network can be a numeric embedding of the input image. As yet another example, the task can be object detection and the output generated by the neural network can identify locations in the input image at which particular types of objects are depicted. As yet another example, the task can be image segmentation and the output generated by the neural network can assign each pixel of the input image to a category from a set of categories. In some other cases, the neural network is a neural network that is configured to perform an image generation task, where the input is a conditioning input and the output is a sequence of intensity value inputs for the pixels of an image specified by the conditioning input. As one example, the task may be a neural machine translation task. For example, if the input to the neural network is a sequence of text, e.g., a sequence of words, phrases, characters, or word pieces, in one language, the output generated by the neural network may be a translation of the sequence of text into another language, i.e., a sequence of text in the other language that is a translation of the input sequence of text. The vocabulary for the input tokens may be words, wordpieces or characters of the first language, and the vocabulary for the output tokens may be words, wordpieces or characters of the other language. As a particular example, the task may be a multi-lingual machine translation task, where a single neural network is configured to translate between multiple different source language – target language pairs. In this example, the source language text may be augmented with an identifier that indicates the target language into which the neural network should translate the source language text. Some implementations may be used for automatic code generation. For example the input tokens may represent words, wordpieces or characters in a first natural language and the output tokens may represent instructions in a computer programming or markup language, or instructions for controlling an application program to perform a task e.g. build a data item such as an image or web page. Attorney Docket No.45288-0450WO1 As another example, the task may be an audio processing task. For example, if the input to the neural network is a sequence representing a spoken utterance, the output generated by the neural network may be a score for each of a set of pieces of text, each score representing an estimated likelihood that the piece of text is the correct transcript for the utterance, e.g. for performing a speech-to-text task. As another example, if the input to the neural network is a sequence representing a spoken utterance, the output generated by the neural network can indicate whether a particular word or phrase (“hotword”) was spoken in the utterance. As another example, if the input to the neural network is a sequence representing a spoken utterance, the output generated by the neural network can be a classification of the spoken utterance into one of a plurality of categories, for example an identity of the natural language in which the utterance was spoken. As another example, the task can be a natural language processing or understanding task, e.g., an entailment task, a paraphrase task, a textual similarity task, a sentiment task, a sentence completion task, a grammaticality task, and so on, that operates on a sequence of text in some natural language. As another example, the task can be a text to speech task, where the input is text in a natural language or features of text in a natural language and the network output is a spectrogram, a waveform, or other data defining audio of the text being spoken in the natural language. As another example, the task can be a health prediction task, where the input is a sequence derived from electronic health record data for a patient and the output is a prediction that is relevant to the future health of the patient, e.g., a predicted treatment that should be prescribed to the patient, the likelihood that an adverse health event will occur to the patient, or a predicted diagnosis for the patient. Such electronic health data may, for example, comprise one or more sequences of physiological data taken from a patient, with the output being a corresponding prediction that relates to those sequences of data. Examples of physiological data and a corresponding prediction include: blood glucose measurements, with the prediction being a predicted future blood glucose measurement or the prediction of a hyper- or hypo-glycemic event; a heart rate, with the prediction being the presence or absence of a heart condition, or a future cardiac event; blood pressure measurements, with the prediction being the risk of a future heart condition; or the like. As another example, the task can be a text generation task, where the input is a sequence of text, and the output is another sequence of text, e.g., a completion of the input sequence of text, a response to a question posed in the input sequence, or a sequence of text Attorney Docket No.45288-0450WO1 that is about a topic specified by the first sequence of text. As another example, the input to the text generation task can be an input other than text, e.g., an image, and the output sequence can be text that describes the input. In some implementations the input sequence represents data to be compressed, e.g. image data, text data, audio data, or any other type of data; and the output sequence a compressed version of the data. The input and output tokens may each comprise any representation of the data to be compressed / compressed data e.g. symbols or embeddings generated / decoded by a respective neural network. The compressed version of the data can be decompressed by a decoder as described above. As another example, the task can be an agent control task, where the input is a sequence of observations or other data characterizing states of an environment and the output defines an action to be performed by the agent in response to the most recent data in the sequence to perform a particular task. The agent can be, e.g., a mechanical agent such as a real-world or simulated robot, a control system for an industrial facility, or a control system that controls a different kind of agent. The observations may comprise sensor data captured by sensors associated with (e.g. part of) the agent, for example visual data, LIDAR data, sonar data, agent configuration data (e.g. joint angles), agent orientation data, or the like. In some implementations, the environment is a real-world environment, the agent is a mechanical (or electro-mechanical) agent interacting with the real-world environment, e.g., a robot or an autonomous or semi-autonomous land, air, or sea vehicle operating in or navigating through the environment, and the actions are actions taken by the mechanical agent in the real-world environment to perform the task. For example, the agent may be a robot interacting with the environment to accomplish a specific task, e.g., to locate or manipulate an object of interest in the environment or to move an object of interest to a specified location in the environment or to navigate to a specified destination in the environment. In these implementations, the observations may include, e.g., one or more of: images, object position data, and sensor data to capture observations as the agent interacts with the environment, for example sensor data from an image, distance, or position sensor or from an actuator. For example in the case of a robot, the observations may include data characterizing the current state of the robot, e.g., one or more of: joint position, joint velocity, joint force, torque or acceleration, e.g., gravity-compensated torque feedback, and global or relative pose of an item held by the robot. In the case of a robot or other Attorney Docket No.45288-0450WO1 mechanical agent or vehicle the observations may similarly include one or more of the position, linear or angular velocity, force, torque or acceleration, and global or relative pose of one or more parts of the agent. The observations may be defined in 1, 2 or 3 dimensions, and may be absolute and / or relative observations. The observations may also include, for example, sensed electronic signals such as motor current or a temperature signal; and / or image or video data for example captured by a camera or a LIDAR sensor, e.g., data from sensors of the agent or data from sensors that are located separately from the agent in the environment. In these implementations, the actions may be control signals to control the robot or other mechanical agent, e.g., torques for the joints of the robot or higher-level control commands, or the autonomous or semi-autonomous land, air, sea vehicle, e.g., torques to the control surface or other control elements e.g. steering control elements of the vehicle, or higher-level control commands. The control signals can include for example, position, velocity, or force / torque / acceleration data for one or more joints of a robot or parts of another mechanical agent. The control signals may also or instead include electronic control data such as motor control data, or more generally data for controlling one or more electronic devices within the environment the control of which has an effect on the observed state of the environment. For example in the case of an autonomous or semi-autonomous land or air or sea vehicle the control signals may define actions to control navigation e.g. steering, and movement e.g., braking and / or acceleration of the vehicle. In some implementations the environment is a simulation of the above-described real-world environment, and the agent is implemented as one or more computers interacting with the simulated environment. For example, a system implementing the neural network may be used to select actions in the simulated environment during training or evaluation of the system and, after training, or evaluation, or both, are complete, the action selection policy may be deployed for controlling a real-world agent in the particular real-world environment that was the subject of the simulation. This can avoid unnecessary wear and tear on and damage to the real-world environment or real-world agent and can allow the control neural network to be trained and evaluated on situations that occur rarely or are difficult or unsafe to re-create in the real-world environment. For example the system may be partly trained using a simulation of a mechanical agent in a simulation of a particular real-world environment, and afterwards deployed to control the real mechanical agent in the particular real-world environment. Thus in such cases the observations of the simulated environment relate to the real-world environment, and the selected actions in the simulated Attorney Docket No.45288-0450WO1 environment relate to actions to be performed by the mechanical agent in the real-world environment. In some implementations, as described above, the agent may not include a human being (e.g. it is a robot). Conversely, in some implementations the agent comprises a human user of a digital assistant such as a smart speaker, smart display, or other device. Then the information defining the task can be obtained from the digital assistant, and the digital assistant can be used to instruct the user based on the task. For example, a system implementing the neural network may output to the human user, via the digital assistant, instructions for actions for the user to perform at each of a plurality of time steps. The instructions may for example be generated in the form of natural language (transmitted as sound and / or text on a screen) based on actions chosen by the system. The system chooses the actions such that they contribute to performing a task. A monitoring system (e.g. a video camera system) may be provided for monitoring the action (if any) which the user actually performs at each time step, in case (e.g. due to human error) it is different from the action which the system instructed the user to perform. Using the monitoring system the system can determine whether the task has been completed. The system may identify actions which the user performs incorrectly with more than a certain probability. If so, when the system instructs the user to perform such an identified action, the system may warn the user to be careful. Alternatively or additionally, the system may learn not to instruct the user to perform the identified actions, i.e. ones which the user is likely to perform incorrectly. More generally, the digital assistant instructing the user may comprise receiving, at the digital assistant, a request from the user for assistance and determining, in response to the request, a series of tasks for the user to perform, e.g. steps or sub-tasks of an overall task. Then for one or more tasks of the series of tasks, e.g. for each task, e.g. until a final task of the series the digital assistant can be used to output to the user an indication of the task, e.g. step or sub-task, to be performed. This may be done using natural language, e.g. on a display and / or using a speech synthesis subsystem of the digital assistant. Visual, e.g. video, and / or audio observations of the user performing the task may be captured, e.g. using the digital assistant. A system as described above may then be used to determine whether the user has successfully achieved the task e.g. step or sub-task, i.e. from the answer as previously described. If there are further tasks to be completed the digital assistant may then, in response, progress to the next task (if any) of the series of tasks, e.g. by outputting an indication of the next task to be performed. In this way the user may be led step-by-step Attorney Docket No.45288-0450WO1 through a series of tasks to perform an overall task. During the training of the neural network, training rewards may be generated e.g. from video data representing examples of the overall task (if corpuses of such data are available) or from a simulation of the overall task. In a further aspect there is provided a digital assistant device including a system as described above. The digital assistant can also include a user interface to enable a user to request assistance and to output information. In implementations this is a natural language user interface and may comprise a keyboard, voice input-output subsystem, and / or a display. The digital assistant can further include an assistance subsystem configured to determine, in response to the request, a series of tasks for the user to perform. In implementations this may comprise a generative (large) language model, in particular for dialog, e.g. a conversation agent such as Sparrow (Glaese et al. arXiv:2209.14375) or Chinchilla (Hoffmann et al. arXiv:2203.15556). The digital assistant can have an observation capture subsystem to capture visual and / or audio observations of the user performing a task; and an interface for the above-described language model neural network (which may be implemented locally or remotely). The digital assistant can also have an assistance control subsystem configured to assist the user. The assistance control subsystem can be configured to perform the steps described above, for one or more tasks e.g. of a series of tasks, e.g. until a final task of the series. More particularly the assistance control subsystem and output to the user an indication of the task to be performed, capture, using the observation capture subsystem, visual or audio observations of the user performing the task, determine from the above-described answer whether the user has successfully achieved the task. In response the digital assistant can progress to a next task of the series of tasks and / or control the digital assistant, e.g. to stop capturing observations. As another example, the task can be a genomics task, where the input is a sequence representing a fragment of a DNA sequence or other molecule sequence and the output is either an embedding of the fragment for use in a downstream task, e.g., by making use of an unsupervised learning technique on a data set of DNA sequence fragments, or an output for the downstream task. Examples of downstream tasks include promoter site prediction, methylation analysis, predicting functional effects of non-coding variants, and so on. In some cases, the machine learning task is a combination of multiple individual machine learning tasks, i.e., the system is configured to perform multiple different individual machine learning tasks, e.g., two or more of the machine learning tasks mentioned above. For example, the system can be configured to perform multiple Attorney Docket No.45288-0450WO1 individual natural language understanding tasks, with the network input including an identifier for the individual natural language understanding task to be performed on the network input. In some cases, the machine learning task is a multi-modal processing task that requires processing multi-modal data. In general, multi-modal data is a combination of two or more different types of data, e.g., two or more of audio data, image data, text data, or graph data. As one example the multi-modal data may comprise audio-visual data, comprising a combination of pixels of an image or of video and audio data representing values of a digitized audio waveform. As another example the multi-modal data may comprise a combination of i) text data representing text in a natural language and ii) pixels of an image or of video or audio data representing values of an audio waveform. Optionally, but not necessarily, the different types of data may represent the same or overlapping objects using the different modalities (types), and when processing multi-modal data the data may be mapped into a common embedding space. As a particular example, the task is a multi-modal processing task that requires processing both text and image inputs, so that the neural network includes both a computer vision neural network and a text processing neural network. That is, the target output to be generated by the computer vision neural network for a given image depends on one or more outputs generated by the text processing neural network for one or more corresponding text inputs (and vice versa). Examples of such tasks include open-vocabulary image classification, open-vocabulary object detection, image captioning, text-based image search, image-based retrieval, and so on. More generally, the multi-modal processing task may correspond to any of the tasks previously described for any of the types of data making up the multi-modal combination. For example, an accuracy of the previously described tasks may be increased when the task is applied to multi-modal data combining the data for which the task has been previously described and another type of data. For example detection or classification of an object or event may be improved when data of multiple different types (modalities) is processed. In this specification, the term "configured" is used in relation to computing systems and environments, as well as computer program components. A computing system or environment is considered "configured" to perform specific operations or actions when it possesses the necessary software, firmware, hardware, or a combination thereof, enabling it to carry out those operations or actions during operation. For instance, configuring a system might involve installing a software library with specific algorithms, updating firmware with Attorney Docket No.45288-0450WO1 new instructions for handling data, or adding a hardware component for enhanced processing capabilities. Similarly, one or more computer programs are "configured" to perform particular operations or actions when they contain instructions that, upon execution by a computing device or hardware, cause the device to perform those intended operations or actions. The embodiments and functional operations described in this specification can be implemented in various forms, including digital electronic circuitry, software, firmware, computer hardware (encompassing the disclosed structures and their structural equivalents), or any combination thereof. The subject matter can be realized as one or more computer programs, essentially modules of computer program instructions encoded on a tangible non- transitory storage medium for execution by or to control the operation of a computing device or hardware. The storage medium can be a storage device such as a hard drive or solid-state drive (SSD), a storage medium, a random or serial access memory device, or a combination of these. Additionally or alternatively, the program instructions can be encoded on a transmitted signal, such as a machine-generated electrical, optical, or electromagnetic signal, designed to carry information for transmission to a receiving device or system for execution by a computing device or hardware. Furthermore, implementations may leverage emerging technologies like quantum computing or neuromorphic computing for specific applications, and may be deployed in distributed or cloud-based environments where components reside on different machines or within a cloud infrastructure. The term "computing device or hardware" refers to the physical components involved in data processing and encompasses all types of devices and machines used for this purpose. Examples include processors or processing units, computers, multiple processors or computers working together, graphics processing units (GPUs), tensor processing units (TPUs), and specialized processing hardware such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs). In addition to hardware, a computing device or hardware may also include code that creates an execution environment for computer programs. This code can take the form of processor firmware, a protocol stack, a database management system, an operating system, or a combination of these elements. Embodiments may particularly benefit from utilizing the parallel processing capabilities of GPUs, in a General-Purpose computing on Graphics Processing Units (GPGPU) context, where code specifically designed for GPU execution, often called kernels or shaders, is employed. Similarly, TPUs excel at running optimized tensor operations crucial for many machine learning algorithms. By leveraging these accelerators and their specialized Attorney Docket No.45288-0450WO1 programming models, the system can achieve significant speedups and efficiency gains for tasks involving artificial intelligence and machine learning, particularly in areas such as computer vision, natural language processing, and robotics. A computer program, also referred to as software, an application, a module, a script, code, or simply a program, can be written in any programming language, including compiled or interpreted languages, and declarative or procedural languages. It can be deployed in various forms, such as a standalone program, a module, a component, a subroutine, or any other unit suitable for use within a computing environment. A program may or may not correspond to a single file in a file system and can be stored in various ways. This includes being embedded within a file containing other programs or data (e.g., scripts within a markup language document), residing in a dedicated file, or distributed across multiple coordinated files (e.g., files storing modules, subprograms, or code segments). A computer program can be executed on a single computer or across multiple computers, whether located at a single site or distributed across multiple sites and interconnected through a data communication network. The specific implementation of the computer programs may involve a combination of traditional programming languages and specialized languages or libraries designed for GPGPU programming or TPU utilization, depending on the chosen hardware platform and desired performance characteristics. In this specification, the term "engine" broadly refers to a software-based system, subsystem, or process designed to perform one or more specific functions. An engine is typically implemented as one or more software modules or components installed on one or more computers, which can be located at a single site or distributed across multiple locations. In some instances, one or more dedicated computers may be used for a particular engine, while in other cases, multiple engines may operate concurrently on the same one or more computers. Examples of engine functions within the context of AI and machine learning could include data pre-processing and cleaning, feature engineering and extraction, model training and optimization, inference and prediction generation, and post-processing of results. The specific design and implementation of engines will depend on the overall architecture and the distribution of computational tasks across various hardware components, including CPUs, GPUs, TPUs, and other specialized processors. The processes and logic flows described in this specification can be executed by one or more programmable computers running one or more computer programs to perform functions by operating on input data and generating output. Additionally, graphics processing units (GPUs) and tensor processing units (TPUs) can be utilized to enable Attorney Docket No.45288-0450WO1 concurrent execution of aspects of these processes and logic flows, significantly accelerating performance. This approach offers significant advantages for computationally intensive tasks often found in AI and machine learning applications, such as matrix multiplications, convolutions, and other operations that exhibit a high degree of parallelism. By leveraging the parallel processing capabilities of GPUs and TPUs, significant speedups and efficiency gains compared to relying solely on CPUs can be achieved. Alternatively or in combination with programmable computers and specialized processors, these processes and logic flows can also be implemented using specialized processing hardware, such as field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), for even greater performance or energy efficiency in specific use cases. Computers capable of executing a computer program can be based on general- purpose microprocessors, special-purpose microprocessors, or a combination of both. They can also utilize any other type of central processing unit (CPU). Additionally, graphics processing units (GPUs), tensor processing units (TPUs), and other machine learning accelerators can be employed to enhance performance, particularly for tasks involving artificial intelligence and machine learning. These accelerators often work in conjunction with CPUs, handling specialized computations while the CPU manages overall system operations and other tasks. Typically, a CPU receives instructions and data from read-only memory (ROM), random access memory (RAM), or both. The elements of a computer include a CPU for executing instructions and one or more memory devices for storing instructions and data. The specific configuration of processing units and memory will depend on factors like the complexity of the AI model, the volume of data being processed, and the desired performance and latency requirements. Embodiments can be implemented on a wide range of computing platforms, from small embedded devices with limited resources to large-scale data center systems with high-performance computing capabilities. The system may include storage devices like hard drives, SSDs, or flash memory for persistent data storage. Computer-readable media suitable for storing computer program instructions and data encompass all forms of non-volatile memory, media, and memory devices. Examples include semiconductor memory devices such as read-only memory (ROM), solid-state drives (SSDs), and flash memory devices; hard disk drives (HDDs); optical media; and optical discs such as CDs, DVDs, and Blu-ray discs. The specific type of computer-readable media used will depend on factors such as the size of the data, access speed requirements, cost considerations, and the desired level of portability or permanence. Attorney Docket No.45288-0450WO1 To facilitate user interaction, embodiments of the subject matter described in this specification can be implemented on a computing device equipped with a display device, such as a liquid crystal display (LCD) or an organic light-emitting diode (OLED) display, for presenting information to the user. Input can be provided by the user through various means, including a keyboard), touchscreens, voice commands, gesture recognition, or other input modalities depending on the specific device and application. Additional input methods can include acoustic, speech, or tactile input, while feedback to the user can take the form of visual, auditory, or tactile feedback. Furthermore, computers can interact with users by exchanging documents with a user's device or application. This can involve sending web content or data in response to requests or sending and receiving text messages or other forms of messages through mobile devices or messaging platforms. The selection of input and output modalities will depend on the specific application and the desired form of user interaction. Machine learning models can be implemented and deployed using machine learning frameworks, such as TensorFlow or JAX. These frameworks offer comprehensive tools and libraries that facilitate the development, training, and deployment of machine learning models. Embodiments of the subject matter described in this specification can be implemented within a computing system comprising one or more components, depending on the specific application and requirements. These may include a back-end component, such as a back-end server or cloud-based infrastructure; an optional middleware component, such as a middleware server or application programming interface (API), to facilitate communication and data exchange; and a front-end component, such as a client device with a user interface, a web browser, or an app, through which a user can interact with the implemented subject matter. For instance, the described functionality could be implemented solely on a client device (e.g., for on-device machine learning) or deployed as a combination of front-end and back-end components for more complex applications. These components, when present, can be interconnected using any form or medium of digital data communication, such as a communication network like a local area network (LAN) or a wide area network (WAN) including the Internet. The specific system architecture and choice of components will depend on factors such as the scale of the application, the need for real-time processing, data security requirements, and the desired user experience. The computing system can include clients and servers that may be geographically separated and interact through a communication network. The specific type of network, Attorney Docket No.45288-0450WO1 such as a local area network (LAN), a wide area network (WAN), or the Internet, will depend on the reach and scale of the application. The client-server relationship is established through computer programs running on the respective computers and designed to communicate with each other using appropriate protocols. These protocols may include HTTP, TCP / IP, or other specialized protocols depending on the nature of the data being exchanged and the security requirements of the system. In certain embodiments, a server transmits data or instructions to a user's device, such as a computer, smartphone, or tablet, acting as a client. The client device can then process the received information, display results to the user, and potentially send data or feedback back to the server for further processing or storage. This allows for dynamic interactions between the user and the system, enabling a wide range of applications and functionalities. While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination. Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products. Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited Attorney Docket No.45288-0450WO1 in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. What is claimed is:
Claims
Attorney Docket No.45288-0450WO1 CLAIMS 1. A method performed by one or more computers, the method comprising: receiving a new input; processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that comprises a respective feature value for each of a plurality of features; processing the new input using a gating encoder neural network to generate a gating representation of the new input that comprises a respective gating value for each of the plurality of features; determining, for each of the features, whether the feature is active based on the respective gating value for the feature; and generating a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active.
2. The method of claim 1, wherein the gating encoder neural network is a single linear neural network layer.
3. The method of claim 1 or claim 2, wherein the magnitude encoder neural network comprises a linear neural network layer followed by a non-linear activation function.
4. The method of claim 3, wherein the non-linear activation function is a rectified linear unit (ReLU) activation function.
5. The method of any preceding claim, wherein determining, for each of the features, whether the feature is active based on the respective gating value for the feature comprises: determining that the feature is active only when the respective gating value for the feature exceeds a threshold.
6. The method of claim 5, wherein the threshold is zero.
7. The method of any preceding claim, wherein generating a sparse representation of the new input that includes the respective feature values for the features that have been determined to be active comprises: generating a masking representation that includes a value of one for each feature that has been determined to be active and a value of zero for each feature that not beenAttorney Docket No.45288-0450WO1 determined to be active; and element-wise multiplying the masking representation and the feature representation.
8. The method of any preceding claim, wherein: the gating encoder neural network and the magnitude encoder neural network each include a respective linear layer that has a respective weight matrix that has a respective row corresponding to each of the features, and for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the particular row is constrained to be equal to a respective learned transformation applied to a row of the respective weight matrix of the linear layer of the gating encoder neural network that corresponds to a same feature as the particular row.
9. The method of claim 8, wherein, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, parameters of the respective learned transformation are learned during training of the gating encoder neural network and the magnitude encoder neural network.
10. The method of any preceding claim, wherein: the magnitude encoder neural network and the gating encoder neural network have been jointly trained with a feature decoder neural network on a set of training inputs, and the feature decoder neural network is configured to receive a representation of a given training input and to process the representation of the given training input to generate a reconstruction of the given training input.
11. The method of claim 10, wherein the magnitude encoder neural network, the gating encoder neural network, and the feature decoder neural network have been jointly trained on an objective that, for each training input in the set of training inputs, includes one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network and one or more terms that penalize the gating encoder neural network for designating features as active.
12. The method of claim 11, wherein the one or more terms that penalize the gating encoder neural network for designating features as active comprise: an L1 sparsity penalty term on gating values generated by the gating encoder neural network.Attorney Docket No.45288-0450WO1 13. The method of claim 12, wherein the L1 sparsity penalty term measures an L1 norm of gating values for active features generated by the gating encoder neural network by processing the training input.
14. The method of any one of claims 11-13, wherein the one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network comprise: a first reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a sparse representation of the training input.
15. The method of any one of claims 11-14, wherein the one or more terms that measure a quality of a corresponding reconstruction of the training input generated by the feature decoder neural network comprise: a second reconstruction loss term that measures a quality of a reconstruction of the training input generated by the feature decoder neural network from a representation of the training input that includes only gating values for active features generated by the gating encoder neural network by processing the training input.
16. The method of claim 15, wherein the decoder neural network is not trained using the second reconstruction loss term.
17. The method of claim 15, when dependent on claim 9, wherein, for each particular row of the respective weight matrix of the linear layer of the magnitude encoder neural network, the respective parameters of the learned transformation are not trained using the second reconstruction loss term and the one or more terms that penalize the gating encoder neural network for designating features as active.
18. The method of any preceding claim, wherein the new input is an intermediate activation generated by a hidden layer of a target neural network by processing a network input to the target neural network.
19. The method of claim 18, wherein the target neural network is a language model neural network.Attorney Docket No.45288-0450WO1 20. The method of claim 18 or claim 19, wherein the network input is part of an input sequence to the language model neural network.
21. The method of claim 20, wherein the input sequence is a multi-modal sequence that represents two or more of text, audio, image, or video data.
22. The method of any one of claims 1-21, wherein the new input represents audio, image, or video data.
23. The method of any preceding claim, further comprising: processing the sparse representation to perform a downstream task on the new input.
24. The method of claim 23, wherein the downstream task is classification of the new input.
25. The method of claim 23, wherein the downstream task is compression of the new input.
26. The method of any preceding claim, when dependent on claim 18 wherein the new input is an input associated with a particular property, and wherein the method further comprises: determining, based on the sparse representation, a modified activation; receiving a subsequent input; processing the subsequent input using the target neural network to generate a subsequent intermediate activation of the hidden layer of the target neural network; modifying the subsequent intermediate activation using the modified activation to generate a modified intermediate activation; and processing the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the subsequent input.Attorney Docket No.45288-0450WO1 27. A method performed by one or more computers, the method comprising: receiving a representation of a new input, wherein the representation includes a respective value for each of a plurality of features; and processing the representation of the new input using a feature decoder neural network to generate a reconstruction of the new input, wherein the decoder neural network has been trained jointly with the magnitude encoder neural network and the gating encoder neural network of any preceding claim.
28. The method of claim 27, wherein the representation is a sparse representation that includes zero values for at least a threshold number of the plurality of features.
29. A method performed by one or more computers, the method comprising: receiving a modified activation, wherein the modified activation has been determined based on a sparse representation obtained using the method of any one of claims 18-26, when dependent on claim 18; receiving an input; processing the input using a neural network to generate an intermediate activation of a hidden layer of the neural network; modifying the intermediate activation using the modified activation to generate a modified intermediate activation; and processing the modified intermediate activation using one or more additional layers of the target neural network to generate an output for the input.
30. The method of claim 29, further comprising: determining, based on the sparse representation, the modified activation.
31. The method of claim 29 or 30, wherein the new input used for obtaining the sparse representation using the method of any one of claims 18-26, when dependent on claim 18, is an input associated with a particular property.Attorney Docket No.45288-0450WO1 32. The method of any preceding claim, when dependent on claims 2 and 3, wherein; the single linear neural network layer and the linear neural network layer share a weight matrix; processing the new input using a gating encoder neural network to generate a gating representation of the new input that comprises a respective gating value for each of the plurality of features comprises: computing a product between the new input and the shared weight matrix to generate a vector of initial gating values for each of the plurality of features; and applying a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features; and processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that comprises a respective feature value for each of a plurality of features comprises: applying a learned transformation to the product to generate a vector of initial feature values for each of the plurality of features; applying a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for each of the plurality of features; and applying the non-linear activation function to generate a vector of the respective feature values for each of the plurality of features.
33. The method of one of claims 1-31, when dependent on claims 2 and 3, wherein: the single linear neural network layer and the linear neural network layer share a weight matrix; processing the new input using a magnitude encoder neural network to generate a feature representation of the new input that comprises a respective feature value for each of a plurality of features comprises: computing a product between the new input and the shared weight matrix to generate a vector of initial feature values for each of the plurality of features; applying a second bias vector to the vector of initial feature values for each of the plurality of features to generate a vector of biased feature values for each of the plurality of features; and applying the non-linear activation function to generate a vector of theAttorney Docket No.45288-0450WO1 respective feature values for each of the plurality of features; and processing the new input using a gating encoder neural network to generate a gating representation of the new input that comprises a respective gating value for each of the plurality of features comprises: applying a learned transformation to the product to generate a vector of initial gating values for each of the plurality of features; and applying a first bias vector to the vector of initial gating values for each of the plurality of features to generate a vector of the respective gating values for each of the plurality of features.
34. A system comprising: one or more computers; and one or more storage devices communicatively coupled to the one or more computers, wherein the one or more storage devices store instructions that, when executed by the one or more computers, cause the one or more computers to perform operations of the respective method of any one of claims 1-33.
35. One or more computer storage media storing instructions that when executed by one or more computers cause the one or more computers to perform operations of the respective method of any one of claims 1-33.