The subpopulation of identified interneurons in the local bending reflex receive multiple inputs from dorsal and ventral mechanoreceptors and have outputs to dorsal and ventral motor neurons. Their connections suggest a distributed processing mechanism in which withdrawal from dorsal, ventral, or lateral stimuli is controlled by a single population of approximately 40 multifunctional interneurons, but it is unclear whether additional interneurons dedicated to particular inputs are needed to account for each kind of bend. We therefore asked whether a model could be constructed that reproduced all behaviors without dedicated interneurons. Interneurons in the model were constrained to receive both dorsal and ventral inputs. Connection strengths were adjusted by gradient descent optimization until the model reproduced the amplitude and time course of motor neuron synaptic potentials in intracellular recordings of the response to many different stimuli. After optimization, the similarity between model and identified interneurons showed that additional dedicated interneurons are not necessary to produce all forms of the behavior. Successful optimization of networks with many fewer interneurons showed that the 40-interneuron network is redundant, raising the possibility that the interneurons have additional functions. Finally, optimizing networks with additional constraints produced better matches to some of the identified interneurons and showed that local bending can be produced by two populations of interneurons: one with outputs consistent with dorsal bending, the other with ventral bending. This suggests a simple model in which two principal types of interneurons produce many different behaviors and predicts the type of interneuron that remains to be identified.